[Libreoffice-commits] online.git: wsd/FileServer.cpp

Miklos Vajna vmiklos at collabora.co.uk
Wed Apr 12 11:46:57 UTC 2017


 wsd/FileServer.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4dbdd72bc281646d995c6f427ff1cee67f739802
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Apr 12 13:46:09 2017 +0200

    wsd: avoid std::string::compare() in FileServer
    
    When we are just interested in equality. compare() is more meant for
    sorting functions where negative/zero/positive return value is useful.
    
    Change-Id: I11138a14dc08e23d33f3848aeb734d9f56f3e9f7

diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 8968133b..96552d40 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -177,7 +177,7 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request, Poco::M
             if (it != request.end())
             {
                 // if ETags match avoid re-sending the file.
-                if (!noCache && !it->second.compare("\"" LOOLWSD_VERSION_HASH "\""))
+                if (!noCache && it->second == "\"" LOOLWSD_VERSION_HASH "\"")
                 {
                     // TESTME: harder ... - do we even want ETag support ?
                     std::ostringstream oss;


More information about the Libreoffice-commits mailing list