-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[已重新提PR,待Review] feat: 1) support length_not_equal comparison; 2) All length comparators support numbers
#5207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
wangliang181230
wants to merge
18
commits into
1Panel-dev:v2
from
wangliang181230:PR/feat-newCompare-len-not-eq
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c4e2c8b
perf: Optimize the compare
wangliang181230 e2fe120
perf: 避免 `判断器` 执行所有条件分支
wangliang181230 ee96680
perf: 判断器,添加日志
wangliang181230 a41a379
小调整
wangliang181230 71cff93
小调整
wangliang181230 7e357b7
clean import
wangliang181230 1eab9c0
clean import
wangliang181230 96cde90
clean import
wangliang181230 eefae54
add import
wangliang181230 a743744
feat: support `len_not_eq` comparison
wangliang181230 88e682c
Merge remote-tracking branch 'upstream/v2' into PR/feat-newCompare-le…
wangliang181230 0eb250b
revert
wangliang181230 969b374
Merge remote-tracking branch 'upstream/v2' into PR/feat-newCompare-le…
wangliang181230 a5fb34b
优化所有长度比较器,支持比较数字的长度
wangliang181230 4f675b5
复用代码
wangliang181230 75412c5
调整命名规范
wangliang181230 ce9714f
小调整
wangliang181230 c62ae67
小调整
wangliang181230 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # coding=utf-8 | ||
| """ | ||
| @project: maxkb | ||
| @Author:wangliang181230 | ||
| @file: len_not_equal_compare.py | ||
| @date:2026/4/28 20:17 | ||
| @desc: 长度不等于比较器 | ||
| """ | ||
| from .compare import Compare | ||
| from .len_equal_compare import compute_length | ||
|
|
||
|
|
||
| class LenNotEqualCompare(Compare): | ||
|
|
||
| def compare(self, source_value, compare, target_value): | ||
| try: | ||
| # 计算长度 | ||
| source_length, target_length = compute_length(source_value, target_value) | ||
|
|
||
| # 长度不等于 比较 | ||
| return source_length != target_length | ||
| except Exception: | ||
| return False | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 新特性1:新增长度不等于 |
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compute_length方法