From ecb5d1d063b093267d3b3efa2ae0a6711d5f5b78 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 3 Oct 2026 12:51:40 -0400 Subject: [PATCH] use starts_with instead std::compare --- libi2pd_client/I2PTunnel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libi2pd_client/I2PTunnel.cpp b/libi2pd_client/I2PTunnel.cpp index 3dd60b03..3e73be57 100644 --- a/libi2pd_client/I2PTunnel.cpp +++ b/libi2pd_client/I2PTunnel.cpp @@ -401,7 +401,7 @@ namespace client if (line == "\r") endOfHeader = true; else { - if (!m_ConnectionSent && !line.compare(0, 10, "Connection")) + if (!m_ConnectionSent && line.starts_with ("Connection")) { /* close connection, if not Connection: (U|u)pgrade (for websocket) */ auto x = line.find("pgrade"); @@ -412,7 +412,7 @@ namespace client m_ConnectionSent = true; } - else if (!m_ProxyConnectionSent && !line.compare(0, 16, "Proxy-Connection")) + else if (!m_ProxyConnectionSent && line.starts_with ("Proxy-Connection")) { m_OutHeader << "Proxy-Connection: close\r\n"; m_ProxyConnectionSent = true; @@ -569,7 +569,7 @@ namespace client }; bool matched = false; for (const auto& it: excluded) - if (!line.compare(0, it.length (), it)) + if (line.starts_with (it)) { matched = true; break;