Simplify string to int conversion where possible

This commit is contained in:
Howl
2016-06-13 21:48:09 +02:00
parent 2f027ce853
commit 32738aaae0
5 changed files with 20 additions and 25 deletions

View File

@@ -4,6 +4,8 @@ import (
"database/sql"
"strconv"
"git.zxq.co/ripple/rippleapi/common"
"github.com/gin-gonic/gin"
)
@@ -23,7 +25,7 @@ func genmode(m string) string {
return m
}
func genmodei(m string) int {
v, _ := strconv.Atoi(m)
v := common.Int(m)
if v > 3 || v < 0 {
v = 0
}