Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make Blob.gist trim its guts to 100 els
Large blobs take ages to render and we already limit to 100 els
for Lists and Maps.
  • Loading branch information
zoffixznet committed Oct 5, 2017
1 parent 6c928d6 commit ac8e5f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/Buf.pm
Expand Up @@ -136,7 +136,13 @@ my role Blob[::T = uint8] does Positional[T] does Stringy is repr('VMArray') is
}

multi method gist(Blob:D:) {
self.^name ~ ':0x<' ~ self.list.fmt('%02x', ' ') ~ '>'
self.^name ~ ':0x<' ~ self.map( -> $elem {
given ++$ {
when 101 { '...' }
when 102 { last }
default { $elem.fmt: '%02x' }
}
}) ~ '>'
}
multi method perl(Blob:D:) {
self.^name ~ '.new(' ~ self.join(',') ~ ')';
Expand Down

0 comments on commit ac8e5f4

Please sign in to comment.