Skip to content

Commit a8bc025

Browse files
committed
remove some typo and blank
1 parent 836ab60 commit a8bc025

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

benchmarks/src/main/java/com/esotericsoftware/kryo/benchmarks/io/HugeStringBenchmark.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,4 @@ public void writeAsciiHuge (InputOutputState state) {
4747
Output output = new Output(1024, 1024 * 512);
4848
output.writeAscii(hugeString);
4949
}
50-
51-
}
52-
￿
50+
}

src/com/esotericsoftware/kryo/io/Output.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ public void writeBoolean (boolean value) throws KryoException {
643643
}
644644

645645
// String:
646-
646+
647647
/** Writes the length and string, or null. Short strings are checked and if ASCII they are written more efficiently, else they
648648
* are written as UTF8. If a string is known to be ASCII, {@link #writeAscii(String)} may be used. The string can be read using
649649
* {@link Input#readString()} or {@link Input#readStringBuilder()}.
@@ -663,8 +663,6 @@ public void writeString (String value) throws KryoException {
663663
if (charCount > 1 && charCount <= 32) {
664664
for (int i = 0; i < charCount; i++)
665665
if (value.charAt(i) > 127) break outer;
666-
667-
// todo can combine
668666
if (capacity - position < charCount)
669667
writeAscii_slow(value, charCount);
670668
else {
@@ -694,7 +692,7 @@ public void writeString (String value) throws KryoException {
694692
}
695693
if (charIndex < charCount) writeUtf8_slow(value, charCount, charIndex);
696694
}
697-
695+
698696
/** Writes a string that is known to contain only ASCII characters. Non-ASCII strings passed to this method will be corrupted.
699697
* Each byte is a 7 bit character with the remaining byte denoting if another character is available. This is slightly more
700698
* efficient than {@link #writeString(String)}. The string can be read using {@link Input#readString()} or
@@ -743,7 +741,7 @@ else if (c > 0x07FF) {
743741
}
744742
}
745743
}
746-
744+
747745
private void writeAscii_slow (String value, int charCount) throws KryoException {
748746
if (charCount == 0) return;
749747
if (position == capacity) require(1); // Must be able to write at least one character.
@@ -758,7 +756,9 @@ private void writeAscii_slow (String value, int charCount) throws KryoException
758756
if (require(charsToWrite)) buffer = this.buffer;
759757
}
760758
}
761-
759+
760+
// Primitive arrays:
761+
762762
/** Writes an int array in bulk. This may be more efficient than writing them individually. */
763763
public void writeInts (int[] array, int offset, int count) throws KryoException {
764764
if (capacity >= count << 2) {

0 commit comments

Comments
 (0)