mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: sample: don't needlessly call c_none() in sample_fetch_as_type()
Surprisingly, while about all calls to a sample cast function carefully avoid calling c_none(), sample_fetch_as_type() makes no effort regarding this, while by nature, the function is most often called with an expected output type similar to the one of the expresison. Let's add it to shorten the most common call path.
This commit is contained in:
parent
1a8636d017
commit
3705deea99
@ -1564,7 +1564,8 @@ struct sample *sample_fetch_as_type(struct proxy *px, struct session *sess,
|
||||
if (!sample_casts[smp->data.type][smp_type])
|
||||
return NULL;
|
||||
|
||||
if (!sample_casts[smp->data.type][smp_type](smp))
|
||||
if (sample_casts[smp->data.type][smp_type] != c_none &&
|
||||
!sample_casts[smp->data.type][smp_type](smp))
|
||||
return NULL;
|
||||
|
||||
smp->flags &= ~SMP_F_MAY_CHANGE;
|
||||
|
Loading…
x
Reference in New Issue
Block a user