On 07/28/2015 02:13 PM, Ben Pfaff wrote:
> On Tue, Jul 21, 2015 at 12:59:11PM -0400, Russell Bryant wrote:
>> Add a method to determine of two smaps are equal (have the exact same
>> set of key-value pairs).
>>
>> Signed-off-by: Russell Bryant
>
> Can't this be done in O(n) instead of O(n log n)?
On Tue, Jul 21, 2015 at 12:59:11PM -0400, Russell Bryant wrote:
> Add a method to determine of two smaps are equal (have the exact same
> set of key-value pairs).
>
> Signed-off-by: Russell Bryant
Can't this be done in O(n) instead of O(n log n)?
bool
smap_equal(const struct smap *smap1, const
Add a method to determine of two smaps are equal (have the exact same
set of key-value pairs).
Signed-off-by: Russell Bryant
---
lib/smap.c | 34 ++
lib/smap.h | 2 ++
2 files changed, 36 insertions(+)
diff --git a/lib/smap.c b/lib/smap.c
index 7fe3ce4..86bf89d