mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Use a dedicated copy function to copy dsfs.
Previously we were duplicating the contents of a dsf using straight-up memcpy. Now there's a dsf_copy function wrapping the same memcpy. For the moment, this still has to take a size parameter, because the size isn't stored inside the dsf itself. But once we make a proper data type, it will be.
This commit is contained in:
@ -431,6 +431,8 @@ void dsf_free(int *dsf);
|
||||
|
||||
void print_dsf(int *dsf, int size);
|
||||
|
||||
void dsf_copy(int *to, int *from, int size);
|
||||
|
||||
/* Return the canonical element of the equivalence class containing element
|
||||
* val. If 'inverse' is non-NULL, this function will put into it a flag
|
||||
* indicating whether the canonical element is inverse to val. */
|
||||
|
Reference in New Issue
Block a user