소스 검색

minmea.h: short-cirtuit no-rescale case in minmea_rescale()

Kosma Moczek 11 년 전
부모
커밋
03fd0b399c
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      minmea.h

+ 2 - 0
minmea.h

@@ -102,6 +102,8 @@ static inline int minmea_rescale(int value, int from, int to)
 {
     if (from == 0)
         return 0;
+    if (from == to)
+        return value;
     return (value * to + from / 2) / from;
 }