Skip to content

Commit

Permalink
- Performance improvement in printing Boolean values -- no additional…
Browse files Browse the repository at this point in the history
… String object is created anymore.

- More progress inside NumberGMPq
  • Loading branch information
trizen committed Dec 23, 2015
1 parent e09a3a8 commit 0968745
Show file tree
Hide file tree
Showing 2 changed files with 272 additions and 58 deletions.
4 changes: 2 additions & 2 deletions lib/Sidef/Types/Bool/Bool.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package Sidef::Types::Bool::Bool {
use overload
q{bool} => \&get_value,
q{0+} => \&get_value,
q{""} => \&dump;
q{""} => sub { ${$_[0]} ? 'true' : 'false' };

use parent qw(
Sidef::Object::Object
Expand Down Expand Up @@ -59,7 +59,7 @@ package Sidef::Types::Bool::Bool {

sub dump {
my ($self) = @_;
Sidef::Types::String::String->new($self->get_value ? 'true' : 'false');
Sidef::Types::String::String->new($$self ? 'true' : 'false');
}

};
Expand Down
Loading

0 comments on commit 0968745

Please sign in to comment.