Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
awall
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
awall
Commits
5a4cb73b
Commit
5a4cb73b
authored
Jan 31, 2017
by
Kaarle Ritvanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rule: fix corner cases for chain combiner
parent
0df4dab4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
model.lua
awall/model.lua
+16
-8
No files found.
awall/model.lua
View file @
5a4cb73b
...
...
@@ -446,7 +446,7 @@ function M.Rule:combine(ofs1, ofs2, key, unique)
end
local
chainless
=
filter
(
ofs2
,
function
(
of
)
return
not
of
.
chain
end
)
local
created
=
{}
local
created
local
res
=
{}
for
_
,
of
in
ipairs
(
ofs1
)
do
...
...
@@ -455,16 +455,24 @@ function M.Rule:combine(ofs1, ofs2, key, unique)
local
ofs
=
combinations
(
chainless
,
{{
family
=
of
.
family
}})
assert
(
#
ofs
>
0
)
if
unique
then
assert
(
of
.
family
)
if
created
[
of
.
family
]
then
return
connect
()
end
created
[
of
.
family
]
=
true
local
comb
=
combinations
({
of
},
ofs
)
if
#
comb
<
#
ofs
then
return
connect
()
end
if
#
ofs
>
1
then
return
connect
()
end
if
unique
then
for
_
,
c
in
ipairs
(
comb
)
do
if
c
.
family
then
if
not
created
then
created
=
{}
elseif
created
==
true
or
created
[
c
.
family
]
then
return
connect
()
end
created
[
c
.
family
]
=
true
else
if
created
then
return
connect
()
end
created
=
true
end
end
end
local
comb
=
combinations
({
of
},
ofs
)
if
#
comb
<
#
ofs
then
return
connect
()
end
extend
(
res
,
comb
)
else
table.insert
(
res
,
of
)
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment