gfe-relnote: Change QuicSentPacketManager::SetSendAlgorithm(CongestionControlType) to a no-op if the current and the requested cc_type are the same. Protected by --gfe2_reloadable_flag_quic_set_send_algorithm_noop_if_cc_type_unchanged.

PiperOrigin-RevId: 292011155
Change-Id: Ibac886fb3ebf97c4c54405d462e2c0a4ea1f41ac
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index 9246499..302daf4 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -1121,6 +1121,18 @@
 
 void QuicSentPacketManager::SetSendAlgorithm(
     CongestionControlType congestion_control_type) {
+  if (GetQuicReloadableFlag(
+          quic_set_send_algorithm_noop_if_cc_type_unchanged)) {
+    if (send_algorithm_ && send_algorithm_->GetCongestionControlType() ==
+                               congestion_control_type) {
+      QUIC_RELOADABLE_FLAG_COUNT_N(
+          quic_set_send_algorithm_noop_if_cc_type_unchanged, 1, 2);
+      return;
+    }
+    QUIC_RELOADABLE_FLAG_COUNT_N(
+        quic_set_send_algorithm_noop_if_cc_type_unchanged, 2, 2);
+    // Fallthrough to change the send algorithm.
+  }
   SetSendAlgorithm(SendAlgorithmInterface::Create(
       clock_, &rtt_stats_, &unacked_packets_, congestion_control_type, random_,
       stats_, initial_congestion_window_));