Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcs
dfss
Commits
525d85ce
Commit
525d85ce
authored
Mar 21, 2016
by
Richer Maximilien
Committed by
Loïck Bonniot
Apr 15, 2016
Browse files
[c] Add function to remove from item set
parent
498ce650
Changes
1
Hide whitespace changes
Inline
Side-by-side
dfssc/common/sequence_analysis.go
View file @
525d85ce
...
@@ -105,3 +105,13 @@ func GetAllButOne(s []uint32, e uint32) []uint32 {
...
@@ -105,3 +105,13 @@ func GetAllButOne(s []uint32, e uint32) []uint32 {
return
res
return
res
}
}
// Remove an ID from the sequence
func
Remove
(
s
[]
uint32
,
e
uint32
)
([]
uint32
,
error
)
{
for
i
,
a
:=
range
s
{
if
a
==
e
{
return
append
(
s
[
:
i
],
s
[
i
+
1
:
]
...
),
nil
}
}
return
s
,
errors
.
New
(
"ID not in sequence"
)
}
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