diff options
| author | Bryce McKinlay <mckinlay@redhat.com> | 2001-03-06 01:05:35 +0000 |
|---|---|---|
| committer | Bryce McKinlay <mckinlay@redhat.com> | 2001-03-06 01:05:35 +0000 |
| commit | 515d37df6323ea88f433b2475bc8c8a74eded176 (patch) | |
| tree | b078729c576dd90abf39d51680a89d458e08b8fb /java | |
| parent | 11aa6a4c5cb8cb25ad3858d47abdf18d87a58453 (diff) | |
| download | classpath-515d37df6323ea88f433b2475bc8c8a74eded176.tar.gz | |
* java/util/TreeSet.java (writeObject): Use a for-loop instead of
Iterator.hasNext().
Diffstat (limited to 'java')
| -rw-r--r-- | java/util/TreeSet.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/java/util/TreeSet.java b/java/util/TreeSet.java index df8235227..ba852131a 100644 --- a/java/util/TreeSet.java +++ b/java/util/TreeSet.java @@ -267,11 +267,12 @@ public class TreeSet extends AbstractSet private void writeObject(ObjectOutputStream out) throws IOException { Iterator itr = map.keySet().iterator(); + int size = map.size(); out.writeObject(map.comparator()); - out.writeInt(map.size()); + out.writeInt(size); - while (itr.hasNext()) + for (int i = 0; i < size; i++) out.writeObject(itr.next()); } |
