General

Profile

tonytonyjan (Weihang Jian)

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 2 1 3

Activity

08/10/2020

04:09 AM Ruby Feature #17111 (Assigned): Improve performance of Net::HTTPHeader#set_form by 40%
## diff
```diff
diff --git a/lib/net/http/header.rb b/lib/net/http/header.rb
index a8901e7..3f1a008 100644
--- a/lib/net/http/header.rb
+++ b/lib/net/http/header.rb
@@ -475,9 +475,8 @@ def set_form(params, enctype='application/x-...
tonytonyjan (Weihang Jian)

06/01/2018

06:26 AM Ruby Bug #14795: Should 'net/http' require 'net/http/status' ?
jeremyevans0 (Jeremy Evans) wrote:
> tonytonyjan (Wei-Hang Jian) wrote:
> ...
Hi Jeremy, thank you for the reference, I didn't know that thread before (It seems like there has not been a conclusion yet :(

By the way, I can see that...
tonytonyjan (Weihang Jian)
04:57 AM Ruby Bug #14795: Should 'net/http' require 'net/http/status' ?
IMHO, I would suggest use `Kernel::autoload`, thus we don't need to type `net/http/status` when we want it, and they will never be loaded into memory until we try to access the constant `STATUS_CODES`. Isn't it win-win? tonytonyjan (Weihang Jian)
06:03 AM Ruby Bug #14793: Hash returned from CGI.parse has [] as default value
FYI: https://github.com/ruby/ruby/blob/fef8339f582b125e1fec5f3d47adbb48f7cede92/lib/cgi/core.rb#L393 tonytonyjan (Weihang Jian)

09/20/2017

01:39 PM Ruby Feature #13924 (Open): Add headings/hints to RubyVM::InstructionSequence#disasm
As the official document mentions, this method will return a String with the human readable instructions. However, it is quite hard to read since we can not understand the definition of each column, for example:
~~~ ruby
puts RubyVM:...
tonytonyjan (Weihang Jian)

02/21/2015

10:02 AM Ruby Bug #10877 (Closed): String#sub causes segfault
~~~ruby
str = 'abc'
reg = /(?<foo>a)bc/
str =~ reg
$~['foo'].sub 'a', ''
$~['foo']
~~~
~~~
tmp.rb:5: [BUG] Segmentation fault at 0x00000000000020
Abort trap: 6
~~~
tonytonyjan (Weihang Jian)

Also available in: Atom