[Zrouter-src] ZRouter.org: push to zconf++ libzhttp/request_handler.cpp libzht...
zrouter-src at zrouter.org
zrouter-src at zrouter.org
Wed Feb 22 11:19:07 UTC 2012
details: /rev/83c0ff61206c
changeset: 62:83c0ff61206c
user: "Nicolai Petri <nicolai at petri.dk>"
date: Wed Feb 22 12:18:52 2012 +0100
description:
Use vector - it's faster.
diffstat:
libzhttp/request_handler.cpp | 2 +-
libzhttp/request_handler.hpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diffs (33 lines):
diff -r 72e2490f9d13 -r 83c0ff61206c libzhttp/request_handler.cpp
--- a/libzhttp/request_handler.cpp Wed Feb 22 12:18:36 2012 +0100
+++ b/libzhttp/request_handler.cpp Wed Feb 22 12:18:52 2012 +0100
@@ -57,7 +57,7 @@
return;
}
- std::list<i_request_handler*>::iterator hi = handlers.begin();
+ auto hi = handlers.begin();
while (hi != handlers.end()) {
if ( (*hi)->can_handle(request_path, req)) {
(*hi)->handle(request_path, req, rep);
diff -r 72e2490f9d13 -r 83c0ff61206c libzhttp/request_handler.hpp
--- a/libzhttp/request_handler.hpp Wed Feb 22 12:18:36 2012 +0100
+++ b/libzhttp/request_handler.hpp Wed Feb 22 12:18:52 2012 +0100
@@ -12,7 +12,7 @@
#define HTTP_REQUEST_HANDLER_HPP
#include <string>
-#include <list>
+#include <vector>
#include <boost/noncopyable.hpp>
#include "i_request_handler.hpp"
@@ -40,7 +40,7 @@
private:
/// The directory containing the files to be served.
std::string doc_root_;
- std::list<http::handlers::i_request_handler*> handlers;
+ std::vector<http::handlers::i_request_handler*> handlers;
/// Perform URL-decoding on a string. Returns false if the encoding was
/// invalid.
More information about the Zrouter-src
mailing list