From e393bc245dcb5e0cdd0b76c1de53336734c6edaa Mon Sep 17 00:00:00 2001 From: niczkx Date: Tue, 24 Jul 2012 17:02:56 -0600 Subject: [PATCH] BeniS made tests, loop is faster. --- modules/corelib/ui/uitable.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/corelib/ui/uitable.lua b/modules/corelib/ui/uitable.lua index 5f5df806..801cef4c 100644 --- a/modules/corelib/ui/uitable.lua +++ b/modules/corelib/ui/uitable.lua @@ -132,7 +132,7 @@ function UITable:addRow(data, height) local row = g_ui.createWidget(self.rowBaseStyle, self.dataSpace) if height then row:setHeight(height) end local rowId = #self.rows - if rowId < 1 then rowId = 1 end + while rowId < 1 do rowId = rowId + 1 end rowId = 'row'..rowId row:setId(rowId) @@ -210,4 +210,4 @@ function UITable:setHeaderColumnStyle(style) if table.hasKey(HEADER_ID) then self.columns[HEADER_ID]:setStyle(style) end -end \ No newline at end of file +end