Experiment with simple structured bindings use
https://bugs.webkit.org/show_bug.cgi?id=198905
Reviewed by Darin Adler.
* wtf/URLHelpers.cpp:
(WTF::URLHelpers::mapHostNames):
Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
to see if all the platforms will work with it.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@246826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index 021ad50..84754c7 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,15 @@
+2019-06-25 Sam Weinig <weinig@apple.com>
+
+ Experiment with simple structured bindings use
+ https://bugs.webkit.org/show_bug.cgi?id=198905
+
+ Reviewed by Darin Adler.
+
+ * wtf/URLHelpers.cpp:
+ (WTF::URLHelpers::mapHostNames):
+ Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
+ to see if all the platforms will work with it.
+
2019-06-25 Adam Barth <abarth@webkit.org>
[fuchsia] Update to newer zx_clock_get syscall
diff --git a/Source/WTF/wtf/URLHelpers.cpp b/Source/WTF/wtf/URLHelpers.cpp
index f186267..64004ac 100644
--- a/Source/WTF/wtf/URLHelpers.cpp
+++ b/Source/WTF/wtf/URLHelpers.cpp
@@ -729,9 +729,7 @@
// Do the mapping.
String result = string;
while (!hostNameRanges->isEmpty()) {
- unsigned location, length;
- String mappedHostName;
- std::tie(location, length, mappedHostName) = hostNameRanges->takeLast();
+ auto [location, length, mappedHostName] = hostNameRanges->takeLast();
result = result.replace(location, length, mappedHostName);
}
return result;