Skip to content

Commit

Permalink
Performance improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maikuolan committed Jun 25, 2024
1 parent 3db1dc1 commit 19215d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Versioning guidelines for SemVer can be found at: https://semver.org/

=== Changes made since last versioned release ===

(none)
- [2024.06.25; Maikuolan]: A very minor performance improvement.

=== Version/Release 1.3.4 ===
PATCH RELEASE.
Expand Down
6 changes: 3 additions & 3 deletions src/Aggregator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Aggregator v1.3.4 (last modified: 2023.08.03).
* Aggregator v1.3.5 (last modified: 2024.06.25).
* @link https://github.com/CIDRAM/Aggregator
*
* Description: A stand-alone class implementation of the IPv4+IPv6 IP+CIDR
Expand Down Expand Up @@ -190,11 +190,11 @@ private function stripInvalidCharactersAndSort(&$In)
}
unset($InCount);
$In = array_filter(array_unique(array_map(function ($Line) {
$Line = preg_replace(['~^(?:#| \*|/\*).*~', '~^[^\da-f:./]*~i', '~[ \t].*$~', '~[^\da-f:./]*$~i'], '', $Line);
$Line = preg_replace('~^(?:(?:#| \*|/\*).*|[^\dA-Fa-f:./]*)|(?:[ \t].*|[^\dA-Fa-f:./]*)$~', '', $Line);
if (isset($this->callbacks['newTick']) && is_callable($this->callbacks['newTick'])) {
$this->callbacks['newTick']();
}
return (!$Line || !preg_match('~[\da-f:./]+~i', $Line) || preg_match('~[^\da-f:./]+~i', $Line)) ? '' : $Line;
return ($Line === '' || preg_match('~[^\da-f:./]+~i', $Line)) ? '' : $Line;
}, $In)));
usort($In, function ($A, $B) {
if (($Pos = strpos($A, '/')) !== false) {
Expand Down

0 comments on commit 19215d1

Please sign in to comment.