mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
avoid ORs rightmost
This commit is contained in:
parent
d9c67df256
commit
92f67fed0a
@ -421,16 +421,10 @@ static struct rx_node *_or_term(struct parse_sp *ps)
|
|||||||
static unsigned _depth(struct rx_node *r, unsigned leftmost)
|
static unsigned _depth(struct rx_node *r, unsigned leftmost)
|
||||||
{
|
{
|
||||||
int count = 1;
|
int count = 1;
|
||||||
int or_count = 0;
|
|
||||||
|
|
||||||
while (r->type != CHARSET && LEFT(r)) {
|
while (r->type != CHARSET && LEFT(r) && (leftmost || r->type != OR)) {
|
||||||
count++;
|
count++;
|
||||||
r = LEFT(r);
|
r = LEFT(r);
|
||||||
/* Stop if we pass another OR */
|
|
||||||
if (or_count)
|
|
||||||
break;
|
|
||||||
if (r->type == OR)
|
|
||||||
or_count++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
Loading…
Reference in New Issue
Block a user