summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-09-20 21:01:08 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-20 21:10:46 +0200
commit03a27bc69348c90a39fccf05702aa36870204684 (patch)
treefffec5cfcfa5dc90b0839b73d257d2852565e2c3 /Libraries
parent3ce97b9c0ede6b656fec136a66d7fa8527eaf3ed (diff)
downloadserenity-03a27bc69348c90a39fccf05702aa36870204684.zip
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.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGUI/JsonArrayModel.cpp2
-rw-r--r--Libraries/LibGUI/JsonArrayModel.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Libraries/LibGUI/JsonArrayModel.cpp b/Libraries/LibGUI/JsonArrayModel.cpp
index 0837dbcb55..31e6430200 100644
--- a/Libraries/LibGUI/JsonArrayModel.cpp
+++ b/Libraries/LibGUI/JsonArrayModel.cpp
@@ -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();
}
diff --git a/Libraries/LibGUI/JsonArrayModel.h b/Libraries/LibGUI/JsonArrayModel.h
index 9b19fb81e0..1c44917dcf 100644
--- a/Libraries/LibGUI/JsonArrayModel.h
+++ b/Libraries/LibGUI/JsonArrayModel.h
@@ -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(); }