Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Need to revert xor logic to be correct

  • Loading branch information...
commit e769409f42a151aa11dcca93a6da0c8da449d6fc 1 parent d690ac6
@lizmat lizmat authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 src/core/Any.pm
View
18 src/core/Any.pm
@@ -346,16 +346,16 @@ my class Any {
SELF.delete($key);
if $kv & $p === $default { # :delete:exists?
- $wasthere ?^ $exists
+ !( $wasthere ?^ $exists )
}
- elsif $kv !=== $default { # :delete:exists:kv?
- !$kv | $wasthere ?? ( $key, $wasthere ?^ $exists ) !! ();
+ elsif $kv !=== $default { # :delete:exists?:kv?
+ !$kv | $wasthere ?? ( $key, !( $wasthere ?^ $exists ) ) !! ();
}
- elsif $p !=== $default { # :delete:exists:p?
- !$p | $wasthere ?? RWPAIR($key, $wasthere ?^ $exists) !! ();
+ elsif $p !=== $default { # :delete:exists?:p?
+ !$p | $wasthere ?? RWPAIR($key, !($wasthere ?^ $exists) ) !! ();
}
}
- elsif $kv !=== $default { # :delete:kv?
+ elsif $kv !=== $default { # :delete?:kv?
!$kv | SELF.exists($key) ?? ( $key, SELF.delete($key) ) !! ();
}
elsif $p !=== $default { # :delete:p?
@@ -414,19 +414,19 @@ my class Any {
if $p & $kv === $default { # :delete:exists?
key.map( {
SELF.delete($_) if $wasthere = SELF.exists($_);
- $wasthere ?^ $exists;
+ !( $wasthere ?^ $exists );
} ).eager.Parcel
}
elsif $kv !=== $default { # :delete:exists?:kv?
key.map( {
SELF.delete($_) if $wasthere = SELF.exists($_);
- !$kv | $wasthere ?? ( $_, $wasthere ?^ $exists ) !! ()
+ !$kv | $wasthere ?? ( $_, !( $wasthere ?^ $exists ) ) !! ()
} ).eager.Parcel
}
elsif $p !=== $default { # :delete:exists?:p?
key.map( {
SELF.delete($_) if $wasthere = SELF.exists($_);
- !$p | $wasthere ?? RWPAIR( $_, $wasthere ?^ $exists ) !! ()
+ !$p | $wasthere ?? RWPAIR($_,!($wasthere ?^ $exists)) !! ()
} ).eager.Parcel
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.