mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 02:35:40 +08:00
Modify change * != IntRange.EMPTY to *.isEmpty().not() in ConstructorRulesData, MethodRulesData, MemberRulesData, NameConditions
This commit is contained in:
@@ -49,7 +49,7 @@ internal class ConstructorRulesData internal constructor(
|
|||||||
|
|
||||||
override val isInitialize
|
override val isInitialize
|
||||||
get() = super.isInitializeOfSuper || paramTypes != null || paramCount >= 0 ||
|
get() = super.isInitializeOfSuper || paramTypes != null || paramCount >= 0 ||
|
||||||
paramCountRange != IntRange.EMPTY || paramCountConditions != null
|
paramCountRange.isEmpty().not() || paramCountConditions != null
|
||||||
|
|
||||||
override fun hashCode(other: Any?) = super.hashCode(other) + "[$paramTypes][$paramCount][$paramCountRange]".hashCode()
|
override fun hashCode(other: Any?) = super.hashCode(other) + "[$paramTypes][$paramCount][$paramCountRange]".hashCode()
|
||||||
}
|
}
|
@@ -49,7 +49,7 @@ internal open class MemberRulesData internal constructor(
|
|||||||
* 判断 [matchCount]、[matchCountRange] 规则是否已经初始化 (设置了任意一个参数)
|
* 判断 [matchCount]、[matchCountRange] 规则是否已经初始化 (设置了任意一个参数)
|
||||||
* @return [Boolean]
|
* @return [Boolean]
|
||||||
*/
|
*/
|
||||||
internal val isInitializeOfMatch get() = matchCount >= 0 || matchCountRange != IntRange.EMPTY
|
internal val isInitializeOfMatch get() = matchCount >= 0 || matchCountRange.isEmpty().not()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断 [BaseRulesData] 规则是否已经初始化 (设置了任意一个参数)
|
* 判断 [BaseRulesData] 规则是否已经初始化 (设置了任意一个参数)
|
||||||
|
@@ -56,7 +56,7 @@ internal class MethodRulesData internal constructor(
|
|||||||
|
|
||||||
override val isInitialize
|
override val isInitialize
|
||||||
get() = super.isInitializeOfSuper || name.isNotBlank() || nameConditions != null || paramTypes != null ||
|
get() = super.isInitializeOfSuper || name.isNotBlank() || nameConditions != null || paramTypes != null ||
|
||||||
paramCount >= 0 || paramCountRange != IntRange.EMPTY || paramCountConditions != null || returnType != null
|
paramCount >= 0 || paramCountRange.isEmpty().not() || paramCountConditions != null || returnType != null
|
||||||
|
|
||||||
override fun hashCode(other: Any?) =
|
override fun hashCode(other: Any?) =
|
||||||
super.hashCode(other) + "[$name][$nameConditions][$paramTypes][$paramCount][$paramCountRange][$returnType]".hashCode()
|
super.hashCode(other) + "[$name][$nameConditions][$paramTypes][$paramCount][$paramCountRange][$returnType]".hashCode()
|
||||||
|
@@ -270,7 +270,7 @@ class NameConditions @PublishedApi internal constructor() {
|
|||||||
if (cdsContains != null) cdsContains?.apply { conditions = conditions && it.contains(first, second) }
|
if (cdsContains != null) cdsContains?.apply { conditions = conditions && it.contains(first, second) }
|
||||||
if (cdsMatches != null) cdsMatches?.apply { conditions = conditions && it.matches(regex = this) }
|
if (cdsMatches != null) cdsMatches?.apply { conditions = conditions && it.matches(regex = this) }
|
||||||
if (cdsLength >= 0) conditions = conditions && it.length == cdsLength
|
if (cdsLength >= 0) conditions = conditions && it.length == cdsLength
|
||||||
if (cdsLengthRange != IntRange.EMPTY) conditions = conditions && it.length in cdsLengthRange
|
if (cdsLengthRange.isEmpty().not()) conditions = conditions && it.length in cdsLengthRange
|
||||||
}
|
}
|
||||||
return conditions
|
return conditions
|
||||||
}
|
}
|
||||||
@@ -290,7 +290,7 @@ class NameConditions @PublishedApi internal constructor() {
|
|||||||
if (cdsContains != null) cdsContains?.apply { conditions += "<Contains:[other: $first, isIgnoreCase: $second]> " }
|
if (cdsContains != null) cdsContains?.apply { conditions += "<Contains:[other: $first, isIgnoreCase: $second]> " }
|
||||||
if (cdsMatches != null) cdsMatches?.apply { conditions += "<Matches:[regex: $this]> " }
|
if (cdsMatches != null) cdsMatches?.apply { conditions += "<Matches:[regex: $this]> " }
|
||||||
if (cdsLength >= 0) conditions += "<Length:[num: $cdsLength]> "
|
if (cdsLength >= 0) conditions += "<Length:[num: $cdsLength]> "
|
||||||
if (cdsLengthRange != IntRange.EMPTY) conditions += "<LengthRange:[numRange: $cdsLengthRange]> "
|
if (cdsLengthRange.isEmpty().not()) conditions += "<LengthRange:[numRange: $cdsLengthRange]> "
|
||||||
return "[${conditions.trim()}]"
|
return "[${conditions.trim()}]"
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user