Skip to content

Commit 6727bcb

Browse files
committed
improve performance
1 parent 91102e6 commit 6727bcb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/abstractdataset/abstractdataset.jl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,11 +1109,19 @@ function _nonunique_barrier!(res, groups, seen_groups; first = true)
11091109
nothing
11101110
end
11111111

1112+
function _RAND_NONUNIQUE(x)
1113+
if x == 1
1114+
1
1115+
else
1116+
rand(1:x)
1117+
end
1118+
end
1119+
11121120
function _nonunique_random_leave_barrier!(counts, groups)
11131121
for i in 1:length(groups)
11141122
counts[groups[i]] += 1
11151123
end
1116-
map!(x->rand(1:x), counts, counts)
1124+
map!(_RAND_NONUNIQUE, counts, counts)
11171125
end
11181126

11191127
function _fill_nonunique_randomleave!(res, counts, groups)

0 commit comments

Comments
 (0)