drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arina-ielchiieva <...@git.apache.org>
Subject [GitHub] drill pull request #971: Drill-5834 Add Networking Functions
Date Mon, 23 Oct 2017 11:09:09 GMT
Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/971#discussion_r146223741
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/NetworkFunctions.java
---
    @@ -523,13 +476,13 @@ public void setup() {
     
         public void eval() {
           String ipString = org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(inputIP.start,
inputIP.end, inputIP.buffer);
    -      if( ipString == null || ipString.isEmpty() || ipString.length() == 0 ){
    +      if (ipString == null || ipString.isEmpty()) {
             out.value = 0;
           } else {
             org.apache.commons.validator.routines.InetAddressValidator validator = org.apache.commons.validator.routines.InetAddressValidator.getInstance();
     
             boolean result = validator.isValid(ipString);
    -        if( result == true ){
    +        if (result == true) {
    --- End diff --
    
    1. `if (result) {`
    2. we can rename the variable to `valid` -> `if (valid) {`


---

Mime
View raw message