Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: lib.cpp
- Revision:
- 10:c3556e27e576
- Parent:
- 9:48e93bcd1d5c
- Child:
- 11:1d7021c0739d
diff -r 48e93bcd1d5c -r c3556e27e576 lib.cpp
--- a/lib.cpp Mon Apr 25 01:39:32 2016 +0000
+++ b/lib.cpp Mon Apr 25 01:57:10 2016 +0000
@@ -202,3 +202,20 @@
}
return val;
}
+
+void add_to_table(HASH_RECORD *table, int ind, int user_id, int hash)
+{
+ HASH_RECORD rec = {user_id, hash};
+ table[ind] = rec;
+}
+
+bool contain_hash(HASH_RECORD *table, int table_size, int user_id, int hash)
+{
+ for (int i = 0; i < table_size; i++) {
+ HASH_RECORD h = table[i];
+ if (h.user_id == user_id && h.hash == hash) {
+ return false;
+ }
+ }
+ return false;
+}