Skip to content

Commit 5f3dfd2

Browse files
authored
Merge pull request #191 from SpinnySpiwal/patch-5
Fixed variable name 'length' being 'lenght'
2 parents 8b790c8 + 8f4f719 commit 5f3dfd2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/prometheus/util.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,20 @@ local function readU32(arr)
224224
end
225225

226226
local function bytesToString(arr)
227-
local lenght = arr.n or #arr;
227+
local length = arr.n or #arr;
228228

229-
if lenght < MAX_UNPACK_COUNT then
229+
if length < MAX_UNPACK_COUNT then
230230
return string.char(table.unpack(arr))
231231
end
232232

233233
local str = "";
234-
local overflow = lenght % MAX_UNPACK_COUNT;
234+
local overflow = length % MAX_UNPACK_COUNT;
235235

236236
for i = 1, (#arr - overflow) / MAX_UNPACK_COUNT do
237237
str = str .. string.char(table.unpack(arr, (i - 1) * MAX_UNPACK_COUNT + 1, i * MAX_UNPACK_COUNT));
238238
end
239239

240-
return str..(overflow > 0 and string.char(table.unpack(arr, lenght - overflow + 1, lenght)) or "");
240+
return str..(overflow > 0 and string.char(table.unpack(arr, length - overflow + 1, length)) or "");
241241
end
242242

243243
local function isNaN(n)

0 commit comments

Comments
 (0)