From 704ba2d87733657dea852fa697fc6d23a961a71b Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 17 Aug 2026 04:18:59 +0900 Subject: refactor(preg): replace Preg::split*() with shim preg_split*() preg_split2()'s limit was always -1 and its flags were always either 0 or PREG_SPLIT_DELIM_CAPTURE alone, so both arguments are gone: the shim now exposes preg_split() and preg_split_delim_capture() over a shared preg_split_impl(). That leaves Preg::split()/split4() as bare pass-throughs, so callers use the shim functions directly and the wrappers are dropped along with the now-unreferenced PREG_SPLIT_* constants. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/repository/array_repository.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/repository/array_repository.rs') diff --git a/crates/shirabe/src/repository/array_repository.rs b/crates/shirabe/src/repository/array_repository.rs index b28cccdc..0f3dc237 100644 --- a/crates/shirabe/src/repository/array_repository.rs +++ b/crates/shirabe/src/repository/array_repository.rs @@ -13,7 +13,7 @@ use crate::repository::{ }; use indexmap::IndexMap; use shirabe_pcre::Preg; -use shirabe_php_shim::{implode, php_regex, preg_quote, strtolower}; +use shirabe_php_shim::{implode, php_regex, preg_quote, preg_split, strtolower}; use shirabe_semver::constraint::AnyConstraint; use shirabe_semver::constraint::SimpleConstraint; use std::rc::Weak; @@ -329,11 +329,11 @@ impl RepositoryInterface for ArrayRepository { r#type: Option, ) -> anyhow::Result> { let regex = if mode == crate::repository::SEARCH_FULLTEXT { - let parts = Preg::split(php_regex!("{\\s+}"), &preg_quote(&query, None)); + let parts = preg_split(php_regex!("{\\s+}"), &preg_quote(&query, None)); format!("{{(?:{})}}i", implode("|", &parts)) } else { // vendor/name searches expect the caller to have preg_quoted the query - let parts = Preg::split(php_regex!("{\\s+}"), &query); + let parts = preg_split(php_regex!("{\\s+}"), &query); format!("{{(?:{})}}i", implode("|", &parts)) }; -- cgit v1.3.1-4-g156e