| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
* Enhanced RDoc for String#insert
|
|
|
|
| |
* Enhanced RDoc for String#[]
|
|
|
|
| |
* Enhanced RDoc for String#upto
|
|
|
| |
* Enhanced RDoc for String#succ!
|
|
|
|
| |
* Enhanced RDoc for String#succ
|
|
|
| |
* Enhanced RDoc for String#match?
|
|
|
|
|
|
|
| |
Methods:
=~
match
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Makes some methods doc compliant with https://github.com/ruby/ruby/blob/master/doc/method_documentation.rdoc. Also, other minor revisions to make more consistent.
Methods:
==
===
eql?
<=>
casecmp
casecmp?
index
rindex
|
|
|
|
|
|
|
|
|
| |
`encoding` can be not only an encoding name, but also an Encoding object.
```
s = String.new('foo', encoding: Encoding::US_ASCII)
s.encoding # => #<Encoding:US-ASCII>
```
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Makes some methods doc compliant with https://github.com/ruby/ruby/blob/master/doc/method_documentation.rdoc. Also, other minor revisions to make more consistent.
Methods:
try_convert
+string
-string
concat
<<
prepend
hash
|
|
|
|
|
|
|
|
|
|
|
|
| |
Methods:
::new
#length
#bytesize
#empty?
#+
#*
#%
|
|
|
|
|
| |
Ractors can access this table simultaneously so we need to sync
accesses.
|
|
|
|
| |
fstring pool should be sync with other Ractors.
|
|
|
| |
Returns `nil` instead of an empty string when non-integer number is given (to make it 2.7 compatible).
|
|
|
| |
https://bugs.ruby-lang.org/issues/16150#change-87446
|
|
|
| |
Removes references to *-convertible thingies.
|
|
|
|
|
|
|
|
| |
If the passed string is frozen, bare and not shared, then there
is no need to duplicate it.
Ref: 4ab69ebbd7cef8539f687e1f948845d076461dc6
Ref: https://bugs.ruby-lang.org/issues/11386
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the pattern Regexp given to String#index and String#rindex
contain a /\K/ (lookbehind) operator, these methods return the
position where the beginning of the lookbehind pattern matches, while
they are expected to return the position where the \K matches.
```
# without patch
"abcdbce".index(/b\Kc/) # => 1
"abcdbce".rindex(/b\Kc/) # => 4
```
This patch fixes this problem by using BEG(0) instead of the return
value of rb_reg_search.
```
# with patch
"abcdbce".index(/b\Kc/) # => 2
"abcdbce".rindex(/b\Kc/) # => 5
```
Fixes [Bug #17118]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the pattern given to String#partition and String#rpartition
contain a /\K/ (lookbehind) operator, the methods return strings
sliced at incorrect positions.
```
# without patch
"abcdbce".partition(/b\Kc/) # => ["a", "c", "cdbce"]
"abcdbce".rpartition(/b\Kc/) # => ["abcd", "c", "ce"]
```
This patch fixes the problem by using BEG(0) instead of the return
value of rb_reg_search.
```
# with patch
"abcdbce".partition(/b\Kc/) # => ["ab", "c", "dbce"]
"abcdbce".rpartition(/b\Kc/) # => ["abcdb", "c", "e"]
```
As a side-effect this patch makes String#partition 2x faster when the
pattern is a costly Regexp by performing Regexp search only once,
which was unexpectedly done twice in the original implementation.
Fixes [Bug #17119]
|
|
|
|
|
|
|
| |
Use BEG(0) instead of the result of rb_reg_search to handle the cases
when the separator Regexp contains /\K/ (lookbehind) operator.
Fixes [Bug #17113]
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Not every compilers understand that rb_raise does not return. When a
function does not end with a return statement, such compilers can issue
warnings. We would better tell them about reachabilities.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* Per @nobu review
* Enhanced rdoc for String.new
* Respond to review
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Optimized `String#split` with `/ /` (single space regexp) as
simple string splitting. [ruby-core:98272]
| |compare-ruby|built-ruby|
|:--------------|-----------:|---------:|
|re_space-1 | 432.786k| 1.539M|
| | -| 3.56x|
|re_space-10 | 76.231k| 191.547k|
| | -| 2.51x|
|re_space-100 | 8.152k| 19.557k|
| | -| 2.40x|
|re_space-1000 | 837.405| 2.022k|
| | -| 2.41x|
ruby-core:98272: https://bugs.ruby-lang.org/issues/15771#change-85511
|
|
|
|
| |
To fix build failures.
|
|
|
|
| |
This shall fix compile errors.
|
| |
|
| |
|
| |
|