forked from osmocom/wireshark
0abe10e040
Wireshark defines the relation of equality A == B as A any_eq B <=> An == Bn for at least one An, Bn. More accurately I think this is (formally) an equivalence relation, not true equality. Whichever definition for "==" we choose we must keep the definition of "!=" as !(A == B), otherwise it will lead to logical contradictions like (A == B) AND (A != B) being true. Fix the '!=' relation to match the definition of equality: A != B <=> !(A == B) <=> A all_ne B <=> An != Bn, for every n. This has been the recomended way to write "not equal" for a long time in the documentation, even to the point where != was deprecated, but it just wasn't implemented consistently in the language, which has understandably been a persistent source of confusion. Even a field that is normally well-behaved with "!=" like "ip.src" or "ip.dst" will produce unexpected results with encapsulations like IP-over-IP. The opcode ALL_NE could have been implemented in the compiler instead using NOT and ANY_EQ but I chose to implement it in bytecode. It just seemed more elegant and efficient but the difference was not very significant. Keep around "~=" for any_ne relation, in case someone depends on that, and because we don't have an operator for true equality: A strict_equal B <=> A all_eq B <=> !(A any_ne B). If there is only one value then any_ne and all_ne are the same comparison operation. Implementing this change did not require fixing any tests so it is unlikely the relation "~=" (any_ne) will be very useful. Note that the behaviour of the '<' (less than) comparison relation is a separate, more subtle issue. In the general case the definition of '<' that is used is only a partial order. |
||
---|---|---|
.. | ||
additional_toolbar.cpp | ||
additional_toolbar.h | ||
apply_line_edit.cpp | ||
apply_line_edit.h | ||
byte_view_text.cpp | ||
byte_view_text.h | ||
capture_filter_combo.cpp | ||
capture_filter_combo.h | ||
capture_filter_edit.cpp | ||
capture_filter_edit.h | ||
clickable_label.cpp | ||
clickable_label.h | ||
copy_from_profile_button.cpp | ||
copy_from_profile_button.h | ||
display_filter_combo.cpp | ||
display_filter_combo.h | ||
display_filter_edit.cpp | ||
display_filter_edit.h | ||
dissector_tables_view.cpp | ||
dissector_tables_view.h | ||
drag_drop_toolbar.cpp | ||
drag_drop_toolbar.h | ||
drag_label.cpp | ||
drag_label.h | ||
editor_file_dialog.cpp | ||
editor_file_dialog.h | ||
elided_label.cpp | ||
elided_label.h | ||
expert_info_view.cpp | ||
expert_info_view.h | ||
export_objects_view.cpp | ||
export_objects_view.h | ||
field_filter_edit.cpp | ||
field_filter_edit.h | ||
filter_expression_toolbar.cpp | ||
filter_expression_toolbar.h | ||
find_line_edit.cpp | ||
find_line_edit.h | ||
follow_stream_text.cpp | ||
follow_stream_text.h | ||
interface_toolbar_lineedit.cpp | ||
interface_toolbar_lineedit.h | ||
label_stack.cpp | ||
label_stack.h | ||
overlay_scroll_bar.cpp | ||
overlay_scroll_bar.h | ||
packet_list_header.cpp | ||
packet_list_header.h | ||
pref_module_view.cpp | ||
pref_module_view.h | ||
profile_tree_view.cpp | ||
profile_tree_view.h | ||
qcustomplot.cpp | ||
qcustomplot.h | ||
range_syntax_lineedit.cpp | ||
range_syntax_lineedit.h | ||
rtp_audio_graph.cpp | ||
rtp_audio_graph.h | ||
splash_overlay.cpp | ||
splash_overlay.h | ||
splash_overlay.ui | ||
stock_icon_tool_button.cpp | ||
stock_icon_tool_button.h | ||
syntax_line_edit.cpp | ||
syntax_line_edit.h | ||
tabnav_tree_view.cpp | ||
tabnav_tree_view.h | ||
wireless_timeline.cpp | ||
wireless_timeline.h | ||
wireshark_file_dialog.cpp | ||
wireshark_file_dialog.h |