aboutsummaryrefslogtreecommitdiff
path: root/dsf.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2006-08-05 16:35:25 +0000
committerSimon Tatham <anakin@pobox.com>2006-08-05 16:35:25 +0000
commitf05c25347d66821d928668a7e87dffbf3ffed027 (patch)
treebe35a6724a387b580acaa3e34f03d6cd2c81d39d /dsf.c
parent6837cc46cd4e9341abd393d0269f24538f39e7ae (diff)
downloadpuzzles-f05c25347d66821d928668a7e87dffbf3ffed027.zip
puzzles-f05c25347d66821d928668a7e87dffbf3ffed027.tar.gz
puzzles-f05c25347d66821d928668a7e87dffbf3ffed027.tar.bz2
puzzles-f05c25347d66821d928668a7e87dffbf3ffed027.tar.xz
Extra utility function.
[originally from svn r6780]
Diffstat (limited to 'dsf.c')
-rw-r--r--dsf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/dsf.c b/dsf.c
index a81bc3c..91d4b2c 100644
--- a/dsf.c
+++ b/dsf.c
@@ -28,3 +28,11 @@ void dsf_merge(int *dsf, int v1, int v2)
v2 = dsf_canonify(dsf, v2);
dsf[v2] = v1;
}
+
+void dsf_init(int *dsf, int len)
+{
+ int i;
+
+ for (i = 0; i < len; i++)
+ dsf[i] = i;
+}