diff options
author | Björn Gustavsson <[email protected]> | 2019-06-28 13:11:43 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-06-28 13:11:43 +0200 |
commit | 5149af57dc17afae1ea97fb939192dd9ccb71d82 (patch) | |
tree | b243ffcbe2bcb1f2b95a631d063e445fdb23de0f /lib/stdlib | |
parent | 8899bb6efc878e915c025f284bde16613017a4b3 (diff) | |
parent | b1ff542330a3ad5852d9f0e2c797b879494e6ca9 (diff) | |
download | otp-5149af57dc17afae1ea97fb939192dd9ccb71d82.tar.gz otp-5149af57dc17afae1ea97fb939192dd9ccb71d82.tar.bz2 otp-5149af57dc17afae1ea97fb939192dd9ccb71d82.zip |
Merge branch 'maint'
* maint:
Optimize ordsets:union/1
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/src/ordsets.erl | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/stdlib/src/ordsets.erl b/lib/stdlib/src/ordsets.erl index 176047079b..95b83ded8c 100644 --- a/lib/stdlib/src/ordsets.erl +++ b/lib/stdlib/src/ordsets.erl @@ -150,13 +150,8 @@ union(Es1, []) -> Es1. OrdsetList :: [ordset(T)], Ordset :: ordset(T). -union([S1,S2|Ss]) -> - union1(union(S1, S2), Ss); -union([S]) -> S; -union([]) -> []. - -union1(S1, [S2|Ss]) -> union1(union(S1, S2), Ss); -union1(S1, []) -> S1. +union(OrdsetList) -> + lists:umerge(OrdsetList). %% intersection(OrdSet1, OrdSet2) -> OrdSet. %% Return the intersection of OrdSet1 and OrdSet2. |