Skip to content

Commit

Permalink
LibGUI: Remove unnecessary type cast in JsonArrayModel.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
asynts authored and awesomekling committed Sep 20, 2020
1 parent 3ce97b9 commit 03a27bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Libraries/LibGUI/JsonArrayModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibGUI/JsonArrayModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class JsonArrayModel final : public Model {
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(); }
Expand Down

0 comments on commit 03a27bc

Please sign in to comment.