Skip to content

Commit

Permalink
Sort keys in footgun DBs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDaniel committed Apr 27, 2020
1 parent 13bcd27 commit ad6c20c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Whateverable/FootgunDB.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ method clean {
$!db.unlink if %*ENV<TESTABLE>
}

method read() { from-json slurp $!db }
method write(%data) { spurt $!db, to-json %data }
method read() { from-json slurp $!db }
method write(%data) { spurt $!db, to-json :sorted-keys, %data }
method read-write(&code) {
$!lock.protect: {
my %data := self.read;
Expand Down

0 comments on commit ad6c20c

Please sign in to comment.