File tree 1 file changed +4
-11
lines changed
1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -45,28 +45,21 @@ namespace ccf::http
45
45
46
46
bool operator <(const AcceptHeaderField& other) const
47
47
{
48
- if (q_factor != other.q_factor )
48
+ static constexpr auto float_comp_epsilon = 0 .0000001f ;
49
+ if (abs (q_factor - other.q_factor ) > float_comp_epsilon)
49
50
{
50
51
return q_factor < other.q_factor ;
51
52
}
52
53
53
- if (is_wildcard (mime_type))
54
+ if (is_wildcard (mime_type) && ! is_wildcard (other. mime_type ) )
54
55
{
55
56
return true ;
56
57
}
57
- else if (is_wildcard (other.mime_type ))
58
- {
59
- return false ;
60
- }
61
58
62
- if (is_wildcard (mime_subtype))
59
+ if (is_wildcard (mime_subtype) && ! is_wildcard (other. mime_subtype ) )
63
60
{
64
61
return true ;
65
62
}
66
- else if (is_wildcard (other.mime_subtype ))
67
- {
68
- return false ;
69
- }
70
63
71
64
// Spec says these mime types are now equivalent. For stability, we
72
65
// order them lexicographically
You can’t perform that action at this time.
0 commit comments