Fix error when number of runs reaches the run threshold

This commit is contained in:
Quang Le 2019-07-18 10:39:11 +07:00
parent 814e4e4ad4
commit 275c2734c9
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ func (g *Generator) buildBasicExtras(runs [][]Value, typeName string, runsThresh
// Print the basic extra methods // Print the basic extra methods
g.Printf(stringNameToValueMethod, typeName) g.Printf(stringNameToValueMethod, typeName)
g.Printf(stringValuesMethod, typeName) g.Printf(stringValuesMethod, typeName)
if len(runs) < runsThreshold { if len(runs) <= runsThreshold {
g.Printf(stringBelongsMethodLoop, typeName) g.Printf(stringBelongsMethodLoop, typeName)
} else { // There is a map of values, the code is simpler then } else { // There is a map of values, the code is simpler then
g.Printf(stringBelongsMethodSet, typeName) g.Printf(stringBelongsMethodSet, typeName)