From 414eaf3930b5be88b1e3100865fdb2d8ec4b0671 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 30 Jan 2003 15:20:04 +0000 Subject: [PATCH] compare_to --- panda/src/downloader/documentSpec.cxx | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/panda/src/downloader/documentSpec.cxx b/panda/src/downloader/documentSpec.cxx index 04c5a8f06e..d522814357 100644 --- a/panda/src/downloader/documentSpec.cxx +++ b/panda/src/downloader/documentSpec.cxx @@ -30,18 +30,27 @@ compare_to(const DocumentSpec &other) const { if (_flags != other._flags) { return (_flags - other._flags); } - if (_request_mode != other._request_mode) { - return (int)_request_mode - (int)other._request_mode; - } int c = _url.compare_to(other._url); if (c != 0) { return c; } - c = _tag.compare_to(other._tag); - if (c != 0) { - return c; + if (has_tag()) { + c = _tag.compare_to(other._tag); + if (c != 0) { + return c; + } } - return _date.compare_to(other._date); + if (has_date()) { + c = _date.compare_to(other._date); + if (c != 0) { + return c; + } + } + + // We don't consider _request_mode or _cache_control significant in + // the comparison. + + return 0; } ////////////////////////////////////////////////////////////////////