From dc4665cebff05cbddaa8094fe802f868c3af9ac9 Mon Sep 17 00:00:00 2001 From: Chris Rybicki Date: Wed, 2 Aug 2023 16:20:12 -0400 Subject: [PATCH] struct equality has been implemented --- main.w | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/main.w b/main.w index 45e45a1..543c9db 100644 --- a/main.w +++ b/main.w @@ -5,17 +5,12 @@ bring cloud; // --- utils --- -// TODO: https://github.com/winglang/wing/issues/2939 -let _equalAttributes = inflight (a: ddb.Attribute, b: ddb.Attribute): bool => { - return a.type == b.type && a.value == b.value; -}; - // Check if an array of items contains an item with the given attributes let containsItem = inflight (items: Array>, attributes: Map): bool => { for i in items { let var matches = true; for key in attributes.keys() { - if !_equalAttributes(i.get(key), attributes.get(key)) { + if i.get(key) != attributes.get(key) { matches = false; break; } @@ -31,7 +26,7 @@ let findItem = inflight (items: Array>, attributes: Map