refactor(core): improve backend code by flow idea suggests by jadepeng · Pull Request #2000 · apache/hugegraph

@jadepeng

@codecov

imbajin

StringBuilder sb = new StringBuilder(1 + idString.length());
sb.append(id.type().prefix()).append(idString);
return sb.toString();
return id.type().prefix() + idString;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should warn if it influence the performance. some suggestions are not perf friendly

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里就两个string,用StringBuilder代价更大

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也是, 而且高版本 JDK 编译器似乎已经会自动判断开销转换了. (当然我不确定是从 JDK 几开始的)

javeme

imbajin

imbajin previously approved these changes Nov 7, 2022

@javeme

@jadepeng you can use git rebase and git push -f to update the code

@imbajin

@jadepeng you can use git rebase and git push -f to update the code

image

The github UI will alert update with the master automatically (I have clicked it)

It is safer and doesn't need to review the code again (avoid unnecessary manual rebase operations)

TODO: I'll enable the required in CI after all package renamed

zyxxoo

zyxxoo previously approved these changes Nov 9, 2022

@imbajin

imbajin

javeme