[sheepdog] [PATCH 10/10] sheepfs/http: clear performance tips generated by cppcheck

Ruoyu liangry at ucweb.com
Tue Sep 2 11:14:13 CEST 2014


This patch gets rid of the below message while performing a code
analysis with cppcheck.

[sheepfs/http.c:534] -> [sheepfs/http.c:537]: (performance) Variable
'ret' is reassigned a value before the old one has been used.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 sheepfs/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sheepfs/http.c b/sheepfs/http.c
index 881b1cb..a750684 100644
--- a/sheepfs/http.c
+++ b/sheepfs/http.c
@@ -531,7 +531,7 @@ int http_object_write(const char *path, const char *buf, size_t size,
 		      off_t ignore)
 {
 	char entry[PATH_MAX], url[PATH_MAX];
-	int ret = -EINVAL;
+	int ret;
 
 	/* don't need '\n' at the end of 'buf' */
 	ret = generate_url(buf, size - 1, url, PATH_MAX);
-- 
1.8.3.2





More information about the sheepdog mailing list