I somehow lost my patch count during the checkout-and-rebuilt marathon
to find that Thing-that-is-not-a-bug last Friday, but I'd guess 25 is safe.
It would be nice if this patch would be applied in a single commit without
any additional changes at the same time. I am not 100% sure that it
won't change any existing behaviour and it is easier to revert the change
if it stays small.
Andre'
--
André Pönitz ........................................ [EMAIL PROTECTED]
Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.32
diff -u -p -r1.32 ChangeLog
--- ChangeLog 2001/02/17 18:52:52 1.32
+++ ChangeLog 2001/02/19 10:04:29
@@ -1,3 +1,9 @@
+2001-02-14 André Pönitz <[EMAIL PROTECTED]>
+
+ * 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 <[EMAIL PROTECTED]>
* math_xiter.h: move ipush and ipop to public, add _ on private
@@ -7,7 +13,7 @@
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 <[EMAIL PROTECTED]>
Index: array.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/array.C,v
retrieving revision 1.6
diff -u -p -r1.6 array.C
--- array.C 2001/02/17 18:52:52 1.6
+++ array.C 2001/02/19 10:04:29
@@ -18,12 +18,9 @@ void * my_memcpy(void * ps_in, void cons
}
-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()
@@ -77,10 +74,9 @@ void MathedArray::need_size(int needed)
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;
Index: array.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/array.h,v
retrieving revision 1.15
diff -u -p -r1.15 array.h
--- array.h 2001/02/17 18:52:52 1.15
+++ array.h 2001/02/19 10:04:29
@@ -46,16 +46,7 @@ public:
typedef buffer_type::const_iterator const_iterator;
///
- enum {
- ///
- ARRAY_STEP = 16,
- ///
- ARRAY_MIN_SIZE = 4
- };
-
- ///
- explicit
- MathedArray(int size = ARRAY_STEP);
+ MathedArray();
///
iterator begin();
Index: math_iter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_iter.C,v
retrieving revision 1.34
diff -u -p -r1.34 math_iter.C
--- math_iter.C 2001/02/17 18:52:52 1.34
+++ math_iter.C 2001/02/19 10:04:29
@@ -411,7 +411,8 @@ MathedArray * MathedIter::Copy(int pos1,
--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) {