Thread (21 messages) 21 messages, 4 authors, 2025-04-01
STALE474d
Revisions (2)
  1. v1 [diff vs current]
  2. v2 current

[PATCH v2 1/4] http.c: remove unnecessary casts to long

From: Taylor Blau <hidden>
Date: 2025-03-19 22:23:49
Subsystem: the rest · Maintainer: Linus Torvalds

When parsing 'http.lowSpeedLimit' and 'http.lowSpeedTime', we explicitly
cast the result of 'git_config_int()' to a long before assignment. This
cast has been in place since all the way back in 58e60dd203 (Add support
for pushing to a remote repository using HTTP/DAV, 2005-11-02).

But that cast has always been unnecessary, since long is guaranteed to
be at least as wide as int. Let's drop the cast accordingly.

Noticed-by: Patrick Steinhardt [off-list ref]
Signed-off-by: Taylor Blau <redacted>
---
 http.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/http.c b/http.c
index 0c9a872809..0cbcb079b2 100644
--- a/http.c
+++ b/http.c
@@ -438,11 +438,11 @@ static int http_options(const char *var, const char *value,
 		return 0;
 	}
 	if (!strcmp("http.lowspeedlimit", var)) {
-		curl_low_speed_limit = (long)git_config_int(var, value, ctx->kvi);
+		curl_low_speed_limit = git_config_int(var, value, ctx->kvi);
 		return 0;
 	}
 	if (!strcmp("http.lowspeedtime", var)) {
-		curl_low_speed_time = (long)git_config_int(var, value, ctx->kvi);
+		curl_low_speed_time = git_config_int(var, value, ctx->kvi);
 		return 0;
 	}
 
-- 
2.49.0.4.ge59cf92f8d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help