Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cool
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hans-Peter Deifel
cool
Commits
cae4b8d1
Commit
cae4b8d1
authored
11 years ago
by
Thorsten Wißmann
Browse files
Options
Downloads
Patches
Plain Diff
Normalize agent list
parent
e2dc68f7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CoolUtils.ml
+12
-1
12 additions, 1 deletion
CoolUtils.ml
CoolUtils.mli
+1
-0
1 addition, 0 deletions
CoolUtils.mli
with
13 additions
and
1 deletion
CoolUtils.ml
+
12
−
1
View file @
cae4b8d1
...
...
@@ -11,10 +11,21 @@ module TArray = struct
any
(
fun
y
->
x
==
y
)
arr
let
included
sub
sup
=
all
(
fun
x
->
elem
x
sup
)
sub
let
to_string
ts
arr
=
"[| "
^
(
Array
.
fold_right
(
fun
i
str
->
(
ts
i
)
^
" "
^
str
)
arr
"|]"
)
let
uniq
arr
=
let
combine
n
l
=
match
l
with
|
[]
->
[
n
]
|
m
::
tail
->
if
n
==
m
then
l
else
n
::
l
in
Array
.
of_list
(
Array
.
fold_right
combine
arr
[]
)
end
let
agents
=
ref
([
|
1
;
2
;
3
;
4
;
5
;
6
;
7
;
8
;
9
;
10
|
])
let
cl_get_agents
()
=
!
agents
let
cl_set_agents
arr
=
ignore
(
agents
:=
arr
)
let
cl_set_agents
arr
=
ignore
(
agents
:=
arr
;
Array
.
fast_sort
compare
!
agents
;
agents
:=
TArray
.
uniq
!
agents
)
This diff is collapsed.
Click to expand it.
CoolUtils.mli
+
1
−
0
View file @
cae4b8d1
...
...
@@ -7,6 +7,7 @@ module TArray : sig
val
elem
:
'
a
->
'
a
array
->
bool
val
included
:
'
a
array
->
'
a
array
->
bool
val
to_string
:
(
'
a
->
string
)
->
'
a
array
->
string
val
uniq
:
'
a
array
->
'
a
array
(* delete consecutive duplicates *)
end
val
cl_get_agents
:
unit
->
int
array
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment