mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Remove unnecessary type cast in JsonArrayModel.
Since TCP sequence numbers are randomly choosen 32-bit numbers, it often happend that the most significant bit was set. The cast to a 32-bit signed integer then made the number negative. Thus TCP sequence were shown negative in the SystemMonitor every so often.
This commit is contained in:
parent
3ce97b9c0e
commit
03a27bc693
Notes:
sideshowbarker
2024-07-19 02:19:13 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/03a27bc6934 Pull-request: https://github.com/SerenityOS/serenity/pull/3566
2 changed files with 2 additions and 2 deletions
|
@ -107,7 +107,7 @@ Variant JsonArrayModel::data(const ModelIndex& index, ModelRole role) const
|
|||
if (field_spec.massage_for_display)
|
||||
return field_spec.massage_for_display(object);
|
||||
if (data.is_number())
|
||||
return data.to_i32();
|
||||
return data;
|
||||
return object.get(json_field_name).to_string();
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
return adopt(*new JsonArrayModel(json_path, move(fields)));
|
||||
}
|
||||
|
||||
virtual ~JsonArrayModel() override {}
|
||||
virtual ~JsonArrayModel() override { }
|
||||
|
||||
virtual int row_count(const ModelIndex& = ModelIndex()) const override { return m_array.size(); }
|
||||
virtual int column_count(const ModelIndex& = ModelIndex()) const override { return m_fields.size(); }
|
||||
|
|
Loading…
Reference in a new issue