This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
FString patch
- From: Chris Dean <ctdean at sokitomi dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Sun, 08 Aug 2004 21:50:57 -0700
- Subject: FString patch
Below is a patch to FString to not reset the internal buffer if the
string becomes smaller. This patch makes the behavior consistent
across addAll() and addAllStrings().
Regards,
Chris Dean
Index: gnu/lists/ChangeLog
===================================================================
RCS file: /cvs/kawa/kawa/gnu/lists/ChangeLog,v
retrieving revision 1.81
diff -u -w -r1.81 ChangeLog
--- gnu/lists/ChangeLog 20 Jul 2004 08:25:08 -0000 1.81
+++ gnu/lists/ChangeLog 9 Aug 2004 04:41:37 -0000
@@ -1,3 +1,7 @@
+2004-08-08 Chris Dean <ctdean@sokitomi.com>
+
+ * FString.java (addAllStrings): Only grow the internal buffer.
+
2004-07-20 Per Bothner <per@bothner.com>
* LList.java: Remove useless import statements.
Index: gnu/lists/FString.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/lists/FString.java,v
retrieving revision 1.10
diff -u -w -r1.10 FString.java
--- gnu/lists/FString.java 23 Apr 2004 00:58:09 -0000 1.10
+++ gnu/lists/FString.java 9 Aug 2004 04:41:37 -0000
@@ -226,6 +226,7 @@
int total = size;
for (int i = startIndex; i < args.length; ++i)
total += ((FString) args[i]).size;
+ if (data.length < total)
setBufferLength(total);
for (int i = startIndex; i < args.length; ++i)