refactoring

This commit is contained in:
Manuel Simon Hirsig
2016-07-13 15:52:56 +02:00
parent 4650a2934b
commit 1d9d4fcc78
4 changed files with 2 additions and 50 deletions
+2 -3
View File
@@ -5,10 +5,11 @@
core.xml
control.xml
gui.lua
util\core.lua
util\completion.xml
util\completion.lua
util\persistence.lua
util\sort.lua
util\money.lua
@@ -31,8 +32,6 @@ tables\auction_listing.lua
tables\item_listing.lua
panels\gui.lua
panels\search\core.xml
panels\search\core.lua
panels\search\frames.lua
View File
-8
View File
@@ -1,8 +0,0 @@
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/">
<Script file="completion.lua"/>
<Frame name="AuxCompletionDropDown" inherits="UIDropDownMenuTemplate" hidden="true">
<Anchors><Anchor point="TOPLEFT"><Offset><AbsDimension x="555" y="0"/></Offset></Anchor></Anchors>
</Frame>
</Ui>
-39
View File
@@ -5,45 +5,6 @@ public.LT = {}
public.EQ = {}
public.GT = {}
-- stable sorting
function public.merge_sort(A, comp)
local n = getn(A)
local B = {}
local width = 1
while width <= n do
for i=1, n, 2 * width do
private.merge(A, i, min(i + width, n), min(i + 2 * width - 1, n), B, comp)
end
private.copy_array(B, A, n)
width = 2 * width
end
end
function private.merge(A, start1, start2, last, B, comp)
local i1 = start1
local i2 = start2
for i=start1,last do
if i1 < start2 and (i2 > last or comp(A[i1], A[i2]) == public.LT or comp(A[i1], A[i2]) == public.EQ) then
B[i] = A[i1]
i1 = i1 + 1
else
B[i] = A[i2]
i2 = i2 + 1
end
end
end
function private.copy_array(A, B, n)
for i=1,n do
B[i] = A[i]
end
end
function public.invert_order(ordering)
if ordering == public.LT then
return public.GT