8000 Upgrade to ada 2.7.1 (#41) · ada-url/ada-python@1bae986 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bae986

Browse files
authored
Upgrade to ada 2.7.1 (#41)
1 parent 969f229 commit 1bae986

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

ada_url/ada.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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! */
22
/* begin file src/ada.cpp */
33
#include "ada.h"
44
/* begin file src/checkers.cpp */

ada_url/ada.h

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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! */
22
/* begin file include/ada.h */
33
/**
44
* @file ada.h
@@ -6577,20 +6577,31 @@ inline bool url_aggregator::has_port() const noexcept {
65776577
// is greater than 1, and url's path[0] is the empty string, then append
65786578
// U+002F (/) followed by U+002E (.) to output.
65796579
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.
65826580
#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());
65876594
ADA_ASSERT_TRUE(buffer[components.pathname_start] == '/');
65886595
ADA_ASSERT_TRUE(buffer[components.pathname_start + 1] == '/');
65896596
}
65906597
#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] == '.';
65946605
}
65956606

65966607
[[nodiscard]] inline std::string_view url_aggregator::get_href()
@@ -6798,11 +6809,11 @@ struct url_search_params {
67986809
* C++ style conventional iterator support. const only because we
67996810
* do not really want the params to be modified via the iterator.
68006811
*/
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]; }
68066817

68076818
private:
68086819
typedef std::pair<std::string, std::string> key_value_pair;
@@ -7077,14 +7088,14 @@ url_search_params_entries_iter::next() {
70777088
#ifndef ADA_ADA_VERSION_H
70787089
#define ADA_ADA_VERSION_H
70797090

7080-
#define ADA_VERSION "2.7.0"
7091+
#define ADA_VERSION "2.7.1"
70817092

70827093
namespace ada {
70837094

70847095
enum {
70857096
ADA_VERSION_MAJOR = 2,
70867097
ADA_VERSION_MINOR = 7,
7087-
ADA_VERSION_REVISION = 0,
7098+
ADA_VERSION_REVISION = 1,
70887099
};
70897100

70907101
} // namespace ada

0 commit comments

Comments
 (0)
0