Skip to content

Commit

Permalink
Optimize code: remove unnecessary judgment code. (#3196)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyuguang authored and ralf0131 committed Jan 14, 2019
1 parent e1f4466 commit de204cf
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,10 @@ public static Object compatibleTypeConvert(Object value, Class<?> type) {
// Process string to char array for generic invoke
// See
// - https://github.com/apache/incubator-dubbo/issues/2003
if (string == null) {
return null;
}
else {
int len = string.length();
char[] chars = new char[len];
string.getChars(0, len, chars, 0);
return chars;
}
int len = string.length();
char[] chars = new char[len];
string.getChars(0, len, chars, 0);
return chars;
}
} else if (value instanceof Number) {
Number number = (Number) value;
Expand Down

0 comments on commit de204cf

Please sign in to comment.