|
1 | | -/* auto-generated on 2023-10-10 12:43:54 -0400. Do not edit! */ |
| 1 | +/* auto-generated on 2023-10-18 21:05:28 -0400. Do not edit! */ |
2 | 2 | /* begin file include/ada.h */ |
3 | 3 | /** |
4 | 4 | * @file ada.h |
@@ -6577,20 +6577,31 @@ inline bool url_aggregator::has_port() const noexcept { |
6577 | 6577 | // is greater than 1, and url's path[0] is the empty string, then append |
6578 | 6578 | // U+002F (/) followed by U+002E (.) to output. |
6579 | 6579 | ada_log("url_aggregator::has_dash_dot"); |
6580 | | - // Performance: instead of doing this potentially expensive check, we could |
6581 | | - // just have a boolean value in the structure. |
6582 | 6580 | #if ADA_DEVELOPMENT_CHECKS |
6583 | | - if (components.pathname_start + 1 < buffer.size() && |
6584 | | - components.pathname_start == components.host_end + 2) { |
6585 | | - ADA_ASSERT_TRUE(buffer[components.host_end] == '/'); |
6586 | | - ADA_ASSERT_TRUE(buffer[components.host_end + 1] == '.'); |
| 6581 | + // If pathname_start and host_end are exactly two characters apart, then we |
| 6582 | + // either have a one-digit port such as http://test.com:5?param=1 or else we |
| 6583 | + // have a /.: sequence such as "non-spec:/.//". We test that this is the case. |
| 6584 | + if (components.pathname_start == components.host_end + 2) { |
| 6585 | + ADA_ASSERT_TRUE((buffer[components.host_end] == '/' && |
| 6586 | + buffer[components.host_end + 1] == '.') || |
| 6587 | + (buffer[components.host_end] == ':' && |
| 6588 | + checkers::is_digit(buffer[components.host_end + 1]))); |
| 6589 | + } |
| 6590 | + if (components.pathname_start == components.host_end + 2 && |
| 6591 | + buffer[components.host_end] == '/' && |
| 6592 | + buffer[components.host_end + 1] == '.') { |
| 6593 | + ADA_ASSERT_TRUE(components.pathname_start + 1 < buffer.size()); |
6587 | 6594 | ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/'); |
6588 | 6595 | ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/'); |
6589 | 6596 | } |
6590 | 6597 | #endif |
6591 | | - return !has_opaque_path && |
6592 | | - components.pathname_start == components.host_end + 2 && |
6593 | | - components.pathname_start + 1 < buffer.size(); |
| 6598 | + // Performance: it should be uncommon for components.pathname_start == |
| 6599 | + // components.host_end + 2 to be true. So we put this check first in the |
| 6600 | + // sequence. Most times, we do not have an opaque path. Checking for '/.' is |
| 6601 | + // more expensive, but should be uncommon. |
| 6602 | + return components.pathname_start == components.host_end + 2 && |
| 6603 | + !has_opaque_path && buffer[components.host_end] == '/' && |
| 6604 | + buffer[components.host_end + 1] == '.'; |
6594 | 6605 | } |
6595 | 6606 |
|
6596 | 6607 | [[nodiscard]] inline std::string_view url_aggregator::get_href() |
@@ -6798,11 +6809,11 @@ struct url_search_params { |
6798 | 6809 | * C++ style conventional iterator support. const only because we |
6799 | 6810 | * do not really want the params to be modified via the iterator. |
6800 | 6811 | */ |
6801 | | - inline const auto begin() const { return params.begin(); } |
6802 | | - inline const auto end() const { return params.end(); } |
6803 | | - inline const auto front() const { return params.front(); } |
6804 | | - inline const auto back() const { return params.back(); } |
6805 | | - inline const auto operator[](size_t index) const { return params[index]; } |
| 6812 | + inline auto begin() const { return params.begin(); } |
| 6813 | + inline auto end() const { return params.end(); } |
| 6814 | + inline auto front() const { return params.front(); } |
| 6815 | + inline auto back() const { return params.back(); } |
| 6816 | + inline auto operator[](size_t index) const { return params[index]; } |
6806 | 6817 |
|
6807 | 6818 | private: |
6808 | 6819 | typedef std::pair<std::string, std::string> key_value_pair; |
@@ -7077,14 +7088,14 @@ url_search_params_entries_iter::next() { |
7077 | 7088 | #ifndef ADA_ADA_VERSION_H |
7078 | 7089 | #define ADA_ADA_VERSION_H |
7079 | 7090 |
|
7080 | | -#define ADA_VERSION "2.7.0" |
| 7091 | +#define ADA_VERSION "2.7.1" |
7081 | 7092 |
|
7082 | 7093 | namespace ada { |
7083 | 7094 |
|
7084 | 7095 | enum { |
7085 | 7096 | ADA_VERSION_MAJOR = 2, |
7086 | 7097 | ADA_VERSION_MINOR = 7, |
7087 | | - ADA_VERSION_REVISION = 0, |
| 7098 | + ADA_VERSION_REVISION = 1, |
7088 | 7099 | }; |
7089 | 7100 |
|
7090 | 7101 | } // namespace ada |
|
0 commit comments