summaryrefslogtreecommitdiff
path: root/core/debugger
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-07-15 23:45:57 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-07-23 17:38:28 -0400
commit4e6efd1b07f1c6d53d226977ddc729333b74306a (patch)
treea52f672e7f622bb65e3b65f2a2edc9d19b1ecdcf /core/debugger
parentb918c4c3ce84af1f8af2d06ef31784f48a15551a (diff)
Use C++ iterators for Lists in many situations
Diffstat (limited to 'core/debugger')
-rw-r--r--core/debugger/debugger_marshalls.cpp10
-rw-r--r--core/debugger/local_debugger.cpp6
-rw-r--r--core/debugger/remote_debugger.cpp14
3 files changed, 15 insertions, 15 deletions
diff --git a/core/debugger/debugger_marshalls.cpp b/core/debugger/debugger_marshalls.cpp
index 26f82c2658..b832dd58d5 100644
--- a/core/debugger/debugger_marshalls.cpp
+++ b/core/debugger/debugger_marshalls.cpp
@@ -40,11 +40,11 @@ Array DebuggerMarshalls::ResourceUsage::serialize() {
Array arr;
arr.push_back(infos.size() * 4);
- for (List<ResourceInfo>::Element *E = infos.front(); E; E = E->next()) {
- arr.push_back(E->get().path);
- arr.push_back(E->get().format);
- arr.push_back(E->get().type);
- arr.push_back(E->get().vram);
+ for (ResourceInfo &E : infos) {
+ arr.push_back(E.path);
+ arr.push_back(E.format);
+ arr.push_back(E.type);
+ arr.push_back(E.vram);
}
return arr;
}
diff --git a/core/debugger/local_debugger.cpp b/core/debugger/local_debugger.cpp
index ab368471e4..24833711d5 100644
--- a/core/debugger/local_debugger.cpp
+++ b/core/debugger/local_debugger.cpp
@@ -320,13 +320,13 @@ void LocalDebugger::print_variables(const List<String> &names, const List<Varian
String value;
Vector<String> value_lines;
const List<Variant>::Element *V = values.front();
- for (const List<String>::Element *E = names.front(); E; E = E->next()) {
+ for (const String &E : names) {
value = String(V->get());
if (variable_prefix.is_empty()) {
- print_line(E->get() + ": " + String(V->get()));
+ print_line(E + ": " + String(V->get()));
} else {
- print_line(E->get() + ":");
+ print_line(E + ":");
value_lines = value.split("\n");
for (int i = 0; i < value_lines.size(); ++i) {
print_line(variable_prefix + value_lines[i]);
diff --git a/core/debugger/remote_debugger.cpp b/core/debugger/remote_debugger.cpp
index bdbb7766fa..7d3abc9b46 100644
--- a/core/debugger/remote_debugger.cpp
+++ b/core/debugger/remote_debugger.cpp
@@ -427,16 +427,16 @@ void RemoteDebugger::_send_resource_usage() {
List<RS::TextureInfo> tinfo;
RS::get_singleton()->texture_debug_usage(&tinfo);
- for (List<RS::TextureInfo>::Element *E = tinfo.front(); E; E = E->next()) {
+ for (RS::TextureInfo &E : tinfo) {
DebuggerMarshalls::ResourceInfo info;
- info.path = E->get().path;
- info.vram = E->get().bytes;
- info.id = E->get().texture;
+ info.path = E.path;
+ info.vram = E.bytes;
+ info.id = E.texture;
info.type = "Texture";
- if (E->get().depth == 0) {
- info.format = itos(E->get().width) + "x" + itos(E->get().height) + " " + Image::get_format_name(E->get().format);
+ if (E.depth == 0) {
+ info.format = itos(E.width) + "x" + itos(E.height) + " " + Image::get_format_name(E.format);
} else {
- info.format = itos(E->get().width) + "x" + itos(E->get().height) + "x" + itos(E->get().depth) + " " + Image::get_format_name(E->get().format);
+ info.format = itos(E.width) + "x" + itos(E.height) + "x" + itos(E.depth) + " " + Image::get_format_name(E.format);
}
usage.infos.push_back(info);
}