Merge "Issue #1954 Size Collections better." into omaha_13.4.1
Former-commit-id:dcd7497a1c
[formerly9b88815813
] [formerly73cd1586ae
] [formerly0da0ddf1d8
[formerly73cd1586ae
[formerly 498809acdfab1f9410188d1fbcaa6fc8bb7511ae]]] Former-commit-id:0da0ddf1d8
Former-commit-id: 2d4df3c79e2c6b48fa5e545ade0a1ffeffc6e7df [formerly8a1469d058
] Former-commit-id:edc7b62cbc
This commit is contained in:
commit
035f6a76cb
1 changed files with 5 additions and 4 deletions
|
@ -66,6 +66,7 @@ import com.raytheon.uf.common.serialization.SerializationException;
|
||||||
* Sep 14, 2012 #1169 djohnson Add ability to write another object into the stream directly.
|
* Sep 14, 2012 #1169 djohnson Add ability to write another object into the stream directly.
|
||||||
* Sep 28, 2012 #1195 djohnson Add ability to specify adapter at field level.
|
* Sep 28, 2012 #1195 djohnson Add ability to specify adapter at field level.
|
||||||
* Nov 02, 2012 1302 djohnson No more field level adapters.
|
* Nov 02, 2012 1302 djohnson No more field level adapters.
|
||||||
|
* Apr 25, 2013 1954 bsteffen Size Collections better.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -946,7 +947,7 @@ public class ThriftSerializationContext extends BaseSerializationContext {
|
||||||
|
|
||||||
if (map == null) {
|
if (map == null) {
|
||||||
// assume hashmap if nothing else available
|
// assume hashmap if nothing else available
|
||||||
map = new HashMap(tmap.size);
|
map = new HashMap((int) (tmap.size / 0.75) + 1, 0.75f);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < tmap.size; i++) {
|
for (int i = 0; i < tmap.size; i++) {
|
||||||
|
@ -995,7 +996,7 @@ public class ThriftSerializationContext extends BaseSerializationContext {
|
||||||
|
|
||||||
if (set == null) {
|
if (set == null) {
|
||||||
// assume hashset if nothing else available
|
// assume hashset if nothing else available
|
||||||
set = new HashSet(tset.size);
|
set = new HashSet((int) (tmap.size / 0.75) + 1, 0.75f);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < tset.size; i++) {
|
for (int i = 0; i < tset.size; i++) {
|
||||||
|
@ -1175,7 +1176,7 @@ public class ThriftSerializationContext extends BaseSerializationContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList<String>();
|
list = new ArrayList<String>(innerList.size);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < innerList.size; i++) {
|
for (int i = 0; i < innerList.size; i++) {
|
||||||
list.add(readString());
|
list.add(readString());
|
||||||
|
@ -1213,7 +1214,7 @@ public class ThriftSerializationContext extends BaseSerializationContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList();
|
list = new ArrayList(innerList.size);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < innerList.size; i++) {
|
for (int i = 0; i < innerList.size; i++) {
|
||||||
list.add(this.serializationManager.deserialize(this));
|
list.add(this.serializationManager.deserialize(this));
|
||||||
|
|
Loading…
Add table
Reference in a new issue