fix rb_memsearch() document

## Why?
The explanation of x and y is reversed.

ddbd644001/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;
```
This commit is contained in:
NAITOH Jun 2024-09-14 06:36:11 +09:00 committed by Hiroshi SHIBATA
parent 4956324af3
commit 373f679e48
Notes: git 2024-09-24 06:13:06 +00:00

View file

@ -307,13 +307,13 @@ RBIMPL_ATTR_NONNULL(())
/** /**
* Looks for the passed string in the passed buffer. * 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] 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] n Number of bytes of `y`.
* @param[in] enc Encoding of both `x` and `y`. * @param[in] enc Encoding of both `x` and `y`.
* @retval -1 Not found. * @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. * @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); long rb_memsearch(const void *x, long m, const void *y, long n, rb_encoding *enc);