Skip to content

Commit 1c666e2

Browse files
committed
Use ! empty() in WP_Parser_Node::has_child()
`! empty( $this->children )` short-circuits without calling `count()`, saving one function call per invocation. Co-authored-by: Adam Zieliński <adam@adamziel.com> Adapted from #376
1 parent ea40c31 commit 1c666e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/mysql-on-sqlite/src/parser/class-wp-parser-node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function merge_fragment( $node ) {
109109
* @return bool True if this node has any child nodes or tokens, false otherwise.
110110
*/
111111
public function has_child(): bool {
112-
return count( $this->children ) > 0;
112+
return ! empty( $this->children );
113113
}
114114

115115
/**

0 commit comments

Comments
 (0)