+2001-02-14 André Pönitz <poenitz@htwm.de>
+
+ * array.[Ch]: remove constructor and enums ARRAY_MIN_SIZE and ARRAY_STEP
+
+ * math_iter.C: default-construct and resize array
+
2001-02-17 Lars Gullik Bjønnes <larsbj@lyx.org>
* math_xiter.h: move ipush and ipop to public, add _ on private
remove default arg val. Call the public methods of xiter instead
of private variables.
- * changes to several files beacuse of the above.
+ * changes to several files because of the above.
2001-02-14 André Pönitz <poenitz@htwm.de>
}
-MathedArray::MathedArray(int size)
- : last_(0)
-{
- int const newsize = (size < ARRAY_MIN_SIZE) ? ARRAY_MIN_SIZE : size;
- bf_.resize(newsize);
-}
+MathedArray::MathedArray()
+ : bf_(1, 0), last_(0)
+{}
MathedArray::iterator MathedArray::begin()
void MathedArray::resize(int newsize)
{
- if (newsize < ARRAY_MIN_SIZE)
- newsize = ARRAY_MIN_SIZE;
- newsize += ARRAY_STEP - (newsize % ARRAY_STEP);
- bf_.resize(newsize);
+ // still a bit smelly...
+ ++newsize;
+ bf_.resize(newsize + 1);
if (last_ >= newsize)
last_ = newsize - 1;
bf_[last_] = 0;
typedef buffer_type::const_iterator const_iterator;
///
- enum {
- ///
- ARRAY_STEP = 16,
- ///
- ARRAY_MIN_SIZE = 4
- };
-
- ///
- explicit
- MathedArray(int size = ARRAY_STEP);
+ MathedArray();
///
iterator begin();
--pos2;
int dx = pos2 - pos1;
- a = new MathedArray(dx + MathedArray::ARRAY_MIN_SIZE);
+ a = new MathedArray;
+ a->resize(dx + 1);
// lyxerr << "VA " << pos2 << " " << pos2 << " " << dx << endl;
array->strange_copy(a, (fc) ? 1 : 0, pos1, dx);
if (fc) {