]> Cypherpunks.ru repositories - nncp.git/commitdiff
Simplify else
authorSergey Matveev <stargrave@stargrave.org>
Mon, 20 Sep 2021 19:03:50 +0000 (22:03 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 20 Sep 2021 19:03:50 +0000 (22:03 +0300)
src/nice.go

index 7682a791e3ca83bccc65d3bd58803e2b06fb98d0..90713b04eda37bd0856c8595f97cdb783ad8cddd 100644 (file)
@@ -64,12 +64,11 @@ func NicenessParse(s string) (uint8, error) {
                        return 0, errors.New("too big niceness delta")
                }
                return baseNice - uint8(delta), nil
-       } else {
-               if delta > 32 || (baseNice == NiceBulk && delta > 31) {
-                       return 0, errors.New("too big niceness delta")
-               }
-               return baseNice + uint8(delta), nil
        }
+       if delta > 32 || (baseNice == NiceBulk && delta > 31) {
+               return 0, errors.New("too big niceness delta")
+       }
+       return baseNice + uint8(delta), nil
 }
 
 func NicenessFmt(nice uint8) string {