Changeset 246826 in webkit


Ignore:
Timestamp:
Jun 25, 2019 7:00:47 PM (5 years ago)
Author:
weinig@apple.com
Message:

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.

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r246809 r246826  
     12019-06-25  Sam Weinig  <weinig@apple.com>
     2
     3        Experiment with simple structured bindings use
     4        https://bugs.webkit.org/show_bug.cgi?id=198905
     5
     6        Reviewed by Darin Adler.
     7
     8        * wtf/URLHelpers.cpp:
     9        (WTF::URLHelpers::mapHostNames):
     10        Simplify code using c++ structured bindings (https://en.cppreference.com/w/cpp/language/structured_binding)
     11        to see if all the platforms will work with it.
     12
    1132019-06-25  Adam Barth  <abarth@webkit.org>
    214
  • trunk/Source/WTF/wtf/URLHelpers.cpp

    r245234 r246826  
    730730    String result = string;
    731731    while (!hostNameRanges->isEmpty()) {
    732         unsigned location, length;
    733         String mappedHostName;
    734         std::tie(location, length, mappedHostName) = hostNameRanges->takeLast();
     732        auto [location, length, mappedHostName] = hostNameRanges->takeLast();
    735733        result = result.replace(location, length, mappedHostName);
    736734    }
Note: See TracChangeset for help on using the changeset viewer.