Skip to content

Commit 2361206

Browse files
committed
Fixed errors caused by f20d390
1 parent f9e0cfa commit 2361206

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

csQuery.nut

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,29 @@ csQuery.SELECTOR <- {
1111
ALL_OR_FIRST = 42 // *
1212
}
1313

14-
function csQuery::Find(query) {
14+
local findBy = function(findFunction, arg) {
15+
local ents = [];
16+
for (local ent; ent = findFunction.call(Entities, ent, arg); )
17+
{
18+
ents.push(ent);
19+
}
20+
return ents;
21+
}
22+
23+
local next = function() {
24+
local ents = [];
25+
for (local ent; ent = Entities.Next(ent); )
26+
{
27+
ents.push(ent);
28+
}
29+
return ents;
30+
}
31+
32+
local first = function() {
33+
return [ Entities.Next(null) ];
34+
}
35+
36+
function csQuery::Find(query) : (findBy, next, first) {
1537
if (typeof query == "instance")
1638
return QueryArray([query]);
1739

@@ -41,26 +63,4 @@ function csQuery::Find(query) {
4163
}
4264

4365
return QueryArray(output);
44-
}
45-
46-
local findBy = function(findFunction, arg) {
47-
local ents = [];
48-
for (local ent; ent = findFunction.call(Entities, ent, arg); )
49-
{
50-
ents.push(ent);
51-
}
52-
return ents;
53-
}
54-
55-
local next = function() {
56-
local ents = [];
57-
for (local ent; ent = Entities.Next(ent); )
58-
{
59-
ents.push(ent);
60-
}
61-
return ents;
62-
}
63-
64-
local first = function() {
65-
return [ Entities.Next(null) ];
6666
}

0 commit comments

Comments
 (0)