projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4210af
)
fix uf_union if merging a set with itself
author
Matthias Braun
<matze@braunis.de>
Tue, 29 Aug 2006 13:26:48 +0000
(13:26 +0000)
committer
Matthias Braun
<matze@braunis.de>
Tue, 29 Aug 2006 13:26:48 +0000
(13:26 +0000)
[r8139]
ir/adt/unionfind.h
patch
|
blob
|
history
diff --git
a/ir/adt/unionfind.h
b/ir/adt/unionfind.h
index
055907d
..
9364d6b
100644
(file)
--- a/
ir/adt/unionfind.h
+++ b/
ir/adt/unionfind.h
@@
-50,6
+50,9
@@
static INLINE int uf_union(int* data, int set1, int set2) {
int d2 = data[set2];
int newcount;
+ if(set1 == set2)
+ return 0;
+
// need 2 set represantatives
assert(d1 < 0 && d2 < 0);