Refactor work out into worker type

This commit is contained in:
kortschak 2014-08-26 10:12:44 +09:30
parent 95170eb8ed
commit 8df21cd8d9
5 changed files with 224 additions and 203 deletions

View file

@ -46,8 +46,8 @@ func stringsFrom(obj *otto.Object) []string {
lengthValue, _ := obj.Get("length")
length, _ := lengthValue.ToInteger()
ulength := uint32(length)
for index := uint32(0); index < ulength; index += 1 {
name := strconv.FormatInt(int64(index), 10)
for i := uint32(0); i < ulength; i++ {
name := strconv.FormatInt(int64(i), 10)
value, err := obj.Get(name)
if err != nil || !value.IsString() {
continue