Skip to content

Commit 9dbade4

Browse files
update from status
1 parent db68b69 commit 9dbade4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

core/src/main/java/io/grpc/Status.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,13 @@ public static Status fromCodeValue(int codeValue) {
319319

320320
@SuppressWarnings("fallthrough")
321321
private static Status fromCodeValue(byte[] asciiCodeValue) {
322+
if (asciiCodeValue.length == 1 && asciiCodeValue[0] == '0') {
323+
return Status.OK;
324+
}
325+
return fromCodeValueSlow(asciiCodeValue);
326+
}
327+
328+
private static Status fromCodeValueSlow(byte[] asciiCodeValue) {
322329
int index = 0;
323330
int codeValue = 0;
324331
switch (asciiCodeValue.length) {

0 commit comments

Comments
 (0)