From 3b32dcb9f1dc9706b6a74b46e8ebc147e5844616 Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Sun, 28 Apr 2013 20:59:22 +0200 Subject: [PATCH] SessionSerializer: Truly unique URIs Before, only spent uris where sanitized not to be contained within remaining uris. Change this so that each uri in the union(remaining,spent) get saved once at most. The order of the uris will won't be changed, with remaining uris going first followed by spent uris. Also avoid copying the uri std::strings around during dupe checking, usually resulting in better performance regarding CPU and space. --- src/SessionSerializer.cc | 79 +++++++++++++++++++++-------------- test/SessionSerializerTest.cc | 13 +++++- 2 files changed, 59 insertions(+), 33 deletions(-) diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc index ee5c4e61..a0a7613d 100644 --- a/src/SessionSerializer.cc +++ b/src/SessionSerializer.cc @@ -137,24 +137,41 @@ bool writeOption(IOFile& fp, const SharedHandle