[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5430] Eradicate 'size_hint'
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5430] Eradicate 'size_hint' |
Date: |
Mon, 12 Mar 2012 13:59:21 +0000 |
Revision: 5430
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5430
Author: chicares
Date: 2012-03-12 13:59:21 +0000 (Mon, 12 Mar 2012)
Log Message:
-----------
Eradicate 'size_hint'
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/multiple_cell_document.cpp
lmi/trunk/sample.cns
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2012-03-12 05:25:16 UTC (rev 5429)
+++ lmi/trunk/ChangeLog 2012-03-12 13:59:21 UTC (rev 5430)
@@ -29869,3 +29869,21 @@
mc_enum_types.xpp
Provide 'RiderCharges' for certain reports.
+20120312T0515Z <address@hidden> [573]
+
+ input_test.cpp
+Demonstrate xmlwrapp improvement committed 20120228T1113Z.
+
+20120312T0525Z <address@hidden> [573]
+
+ input_test.cpp
+Simplify.
+
+20120312T1359Z <address@hidden> [573]
+
+ multiple_cell_document.cpp
+ sample.cns
+Eradicate 'size_hint'. See:
+ http://lists.nongnu.org/archive/html/lmi/2012-02/msg00010.html
+ http://lists.nongnu.org/archive/html/lmi/2012-02/msg00012.html
+
Modified: lmi/trunk/multiple_cell_document.cpp
===================================================================
--- lmi/trunk/multiple_cell_document.cpp 2012-03-12 05:25:16 UTC (rev
5429)
+++ lmi/trunk/multiple_cell_document.cpp 2012-03-12 13:59:21 UTC (rev
5430)
@@ -36,6 +36,7 @@
#include <xmlwrapp/nodes_view.h>
#include <istream>
+#include <iterator> // std::distance()
#include <ostream>
#include <stdexcept>
@@ -113,8 +114,6 @@
} // Unnamed namespace.
/// Read xml into vectors of class Input.
-///
-/// The optional "size_hint" attributes improve speed remarkably.
void multiple_cell_document::parse(xml::element const& root)
{
@@ -149,12 +148,8 @@
: ("particular_cells" == tag) ? cell_parms_
: hurl<std::vector<Input> >("Unexpected element '" + tag + "'.")
);
- int size_hint = 0;
- if(xml_lmi::get_attr(*i, "size_hint", size_hint))
- {
- v.reserve(size_hint);
- }
xml::const_nodes_view const subelements(i->elements());
+ v.reserve(std::distance(subelements.begin(), subelements.end()));
for(cnvi j = subelements.begin(); j != subelements.end(); ++j)
{
*j >> cell;
@@ -330,7 +325,6 @@
xml::element class_defaults("class_defaults");
xml::node::iterator classes_i = root.insert(class_defaults);
- xml_lmi::set_attr(*classes_i, "size_hint", class_parms_.size());
for(svii i = class_parms_.begin(); i != class_parms_.end(); ++i)
{
i->write(*classes_i);
@@ -338,7 +332,6 @@
xml::element particular_cells("particular_cells");
xml::node::iterator cells_i = root.insert(particular_cells);
- xml_lmi::set_attr(*cells_i, "size_hint", cell_parms_.size());
for(svii i = cell_parms_.begin(); i != cell_parms_.end(); ++i)
{
i->write(*cells_i);
Modified: lmi/trunk/sample.cns
===================================================================
--- lmi/trunk/sample.cns 2012-03-12 05:25:16 UTC (rev 5429)
+++ lmi/trunk/sample.cns 2012-03-12 13:59:21 UTC (rev 5430)
@@ -203,7 +203,7 @@
<ZipCode/>
</cell>
</case_default>
- <class_defaults size_hint="1">
+ <class_defaults>
<cell version="6">
<AccidentalDeathBenefit>No</AccidentalDeathBenefit>
<Address/>
@@ -406,7 +406,7 @@
<ZipCode/>
</cell>
</class_defaults>
- <particular_cells size_hint="1">
+ <particular_cells>
<cell version="6">
<AccidentalDeathBenefit>No</AccidentalDeathBenefit>
<Address/>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5430] Eradicate 'size_hint',
Greg Chicares <=