From fed0a6e7ac361af9b963c1f62411b1a85478230c Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 18 Aug 2026 01:57:02 +0900 Subject: refactor(preg): add preg_is_match for existence-only call sites The capture groups were discarded at 162 of the preg_match call sites, which only tested the Option. They now call preg_is_match, which lets the regex engine skip capture tracking. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/autoload/autoload_generator.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/shirabe/src/autoload') diff --git a/crates/shirabe/src/autoload/autoload_generator.rs b/crates/shirabe/src/autoload/autoload_generator.rs index d5e1fcba..5f435566 100644 --- a/crates/shirabe/src/autoload/autoload_generator.rs +++ b/crates/shirabe/src/autoload/autoload_generator.rs @@ -26,9 +26,9 @@ use shirabe_class_map_generator::class_map_generator::ClassMapGenerator; use shirabe_php_shim::{ InvalidArgumentException, PhpMixed, PregMatches, array_keys, array_map, array_merge_map, array_merge_recursive, array_shift, array_slice_strs, array_unique, bin2hex, explode, - file_exists, file_get_contents, hash, implode, is_array, ksort, ltrim, php_regex, preg_match, - preg_quote, preg_replace, preg_replace_callback, random_bytes, realpath, str_replace, strlen, - strpos, strtr, substr, substr_count, trim, unlink, var_export, + file_exists, file_get_contents, hash, implode, is_array, ksort, ltrim, php_regex, + preg_is_match, preg_match, preg_quote, preg_replace, preg_replace_callback, random_bytes, + realpath, str_replace, strlen, strpos, strtr, substr, substr_count, trim, unlink, var_export, }; use shirabe_semver::constraint::Bound; use shirabe_symfony_console::formatter::OutputFormatter; @@ -1126,7 +1126,7 @@ return array( } } - if preg_match(php_regex!("{\\.phar([\\\\/]|$)}"), &path).is_some() { + if preg_is_match(php_regex!("{\\.phar([\\\\/]|$)}"), &path) { base_dir = format!("'phar://' . {}", base_dir); } -- cgit v1.3.1-4-g156e