Quantcast

Simplified some logic

Kevin Lyles [01-19-14 - 21:07]
Simplified some logic
Filename
weights.lua
diff --git a/weights.lua b/weights.lua
index 19d4ee7..973a8d4 100644
--- a/weights.lua
+++ b/weights.lua
@@ -6,9 +6,7 @@ function ww_validateNumber(newChar, newText)
 	if string.find(newChar, "^%d$") then
 		return true
 	elseif newChar == '.' then
-		local first = newText:find(".", 1, true)
-		local second = newText:find(".", first + 1, true)
-		if not second then
+		if not newText:find(".", newText:find(".", 1, true) + 1, true) then
 			return true
 		end
 	elseif newChar == '-' then