diff options
author | NAITOH Jun <[email protected]> | 2024-09-14 06:36:11 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-09-24 15:12:48 +0900 |
commit | 373f679e48068ebead61a029922a48879c39bef5 (patch) | |
tree | 6d5b25acb5fafc75d541c585e46d51101ddadab9 /include/ruby | |
parent | 4956324af3ef3b3f706a863e3ba5239ad77f73c4 (diff) |
fix rb_memsearch() document
## Why?
The explanation of x and y is reversed.
https://github.com/ruby/ruby/blob/ddbd64400199fd408d23c85f9fb0d7f742ecf9e1/re.c#L251-L256
```
long
rb_memsearch(const void *x0, long m, const void *y0, long n, rb_encoding *enc)
{
const unsigned char *x = x0, *y = y0;
if (m > n) return -1;
```
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11625
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/internal/encoding/string.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/ruby/internal/encoding/string.h b/include/ruby/internal/encoding/string.h index 2b9dfe4f31..2cfa91c01e 100644 --- a/include/ruby/internal/encoding/string.h +++ b/include/ruby/internal/encoding/string.h @@ -307,13 +307,13 @@ RBIMPL_ATTR_NONNULL(()) /** * Looks for the passed string in the passed buffer. * - * @param[in] x Buffer that potentially includes `y`. + * @param[in] x Query string. * @param[in] m Number of bytes of `x`. - * @param[in] y Query string. + * @param[in] y Buffer that potentially includes `x`. * @param[in] n Number of bytes of `y`. * @param[in] enc Encoding of both `x` and `y`. * @retval -1 Not found. - * @retval otherwise Found index in `x`. + * @retval otherwise Found index in `y`. * @note This API can match at a non-character-boundary. */ long rb_memsearch(const void *x, long m, const void *y, long n, rb_encoding *enc); |