trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anoopsharma00 <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #560: JIRA 2086 Support for largeint unsign...
Date Fri, 01 Jul 2016 14:43:34 GMT
Github user anoopsharma00 commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/560#discussion_r69309773
  
    --- Diff: core/sql/common/Int64.cpp ---
    @@ -136,6 +140,22 @@ void convertInt64ToAscii(const Int64 &src, char* tgt)
       strcpy(tgt, s);
     }
     
    +void convertUInt64ToAscii(const UInt64 &src, char* tgt)
    +{
    +  UInt64 temp = src;
    +  char buffer[21];
    +  char *s = &buffer[21];
    +  *--s = '\0';
    +  do {
    +    char c = (char) (temp % 10);
    +    if (c < 0)
    +      c = -c;
    --- End diff --
    
    And there is your cut-and-paste issue :)
    This method is a copy of existing method convertInt64ToAscii
    which converts a signed number to ascii.
    
    The new convertUInt64ToAscii method doesn't need the 'c < 0' check though it will
    never be reached. Will fix that for a later checkin.
    
    Existing convert methods in Int64.cpp pass in input value as reference 
    parameter so the new method just followed the same.
    Am not sure what the original intent was, maybe some perf improvement.
    I will leave it as a reference param.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message