Skip to content

Commit

Permalink
Merge branch 'main' into dotnet-example
Browse files Browse the repository at this point in the history
  • Loading branch information
ajewellamz authored Nov 2, 2023
2 parents 43208e5 + 1da5fcd commit 829c067
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions DynamoDbEncryption/dafny/DynamoDbEncryption/src/FilterExpr.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -1429,17 +1429,15 @@ module DynamoDBFilterExpr {
ensures b.ValidState()
modifies b.Modifies()
{
if |ItemList| == 0 {
return Success([]);
}
var newAttrs :- b.GeneratePlainBeacons(ItemList[0]);
var doesMatch :- EvalExpr(parsed, ItemList[0] + newAttrs, names, values);
var rest :- FilterItems(b, parsed, ItemList[1..], names, values);
if doesMatch {
return Success(ItemList[..1] + rest);
} else {
return Success(rest);
var acc : DDB.ItemList := [];
for i := 0 to |ItemList| {
var newAttrs :- b.GeneratePlainBeacons(ItemList[i]);
var doesMatch :- EvalExpr(parsed, ItemList[i] + newAttrs, names, values);
if doesMatch {
acc := acc + [ItemList[i]];
}
}
return Success(acc);
}

// return the results for which the expression is true
Expand Down

0 comments on commit 829c067

Please sign in to comment.