Software / code / prosody
Comparison
util/array.lua @ 1922:d5fe0f9b377a
util.array: Small logic fix for array:filter()
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 05 Oct 2009 18:39:28 +0100 |
| parent | 1921:5ac99cd46545 |
| child | 1934:e14cf28396a8 |
comparison
equal
deleted
inserted
replaced
| 1921:5ac99cd46545 | 1922:d5fe0f9b377a |
|---|---|
| 41 outa[write] = v; | 41 outa[write] = v; |
| 42 write = write + 1; | 42 write = write + 1; |
| 43 end | 43 end |
| 44 end | 44 end |
| 45 | 45 |
| 46 if inplace and write < start_length then | 46 if inplace and write <= start_length then |
| 47 for i=write,start_length do | 47 for i=write,start_length do |
| 48 outa[i] = nil; | 48 outa[i] = nil; |
| 49 end | 49 end |
| 50 end | 50 end |
| 51 | 51 |