Skip to content

Commit

Permalink
avoid duplicate count++ and make it easier to read
Browse files Browse the repository at this point in the history
  • Loading branch information
stephaniewang526 committed Mar 27, 2020
1 parent 2ff57ae commit 76622fc
Showing 1 changed file with 2 additions and 6 deletions.
Expand Up @@ -31,12 +31,8 @@
public class ProtoSchemaConverter {
private static class StructName {
public String getName() {
if (count == 0) {
count++;
return "__ROOT__";
} else {
return "__S" + (count++);
}
count++;
return count == 1 ? "__ROOT__" : "__S" + count;

This comment has been minimized.

Copy link
@bigang-li

bigang-li Mar 27, 2020

should be 0 to keep the same with the original code?

}

private int count = 0;
Expand Down

0 comments on commit 76622fc

Please sign in to comment.