Changeset 6363690 in git


Ignore:
Timestamp:
04/09/19 01:30:51 (7 weeks ago)
Author:
Olly Betts <olly@…>
Branches:
master
Children:
76cf7f1
Parents:
c1002b8
Message:

Add casts when comparing station names

This change shouldn't change the result, but makes it clearer what
the code is doing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/namecompare.cc

    rc1002b8 r6363690  
    5353
    5454         /* shorter sorts first */
    55          res = (ea - sa) - (eb - sb);
     55         res = int(ea - sa) - int(eb - sb);
    5656         /* same length, all digits, so character value compare sorts
    5757          * numerically */
    5858         for (size_t j = sa; !res && j != ea; ++j) {
    59             res = a[j] - b[j - sa + sb];
     59            res = int(a[j]) - int(b[j - sa + sb]);
    6060         }
    6161         /* more leading zeros sorts first */
    62          if (!res) res = sb - sa;
     62         if (!res) res = int(sb) - int(sa);
    6363         if (res) return res;
    6464
Note: See TracChangeset for help on using the changeset viewer.