From 976ef2f4ea785bfe43a765a3c8604afc61342bb1 Mon Sep 17 00:00:00 2001 From: mattpetersepic <58296718+mattpetersepic@users.noreply.github.com> Date: Tue, 8 Feb 2022 20:44:35 -0700 Subject: =?UTF-8?q?Remove=20the=20backwards=20compatibility=20for=20the=20?= =?UTF-8?q?Zen=20CachePolicy=20changes=20no=E2=80=A6=20(#49)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the backwards compatibility for the Zen CachePolicy changes now that there has been enough time for all internal users of the old protocol to update. --- zenutil/cache/cachepolicy.cpp | 12 +----------- zenutil/include/zenutil/cache/cachepolicy.h | 7 ------- 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'zenutil') diff --git a/zenutil/cache/cachepolicy.cpp b/zenutil/cache/cachepolicy.cpp index 8c10ea674..3bca363bb 100644 --- a/zenutil/cache/cachepolicy.cpp +++ b/zenutil/cache/cachepolicy.cpp @@ -122,7 +122,7 @@ ConvertToUpstream(CachePolicy Policy) // Use the downstream value for all other flags. CachePolicy UpstreamPolicy = CachePolicy::None; - + if (EnumHasAllFlags(Policy, CachePolicy::QueryRemote)) { UpstreamPolicy |= CachePolicy::QueryLocal; @@ -206,12 +206,6 @@ OptionalCacheRecordPolicy CacheRecordPolicy::Load(const CbObjectView Object) { std::string_view BasePolicyText = Object["BasePolicy"sv].AsString(); -#if BACKWARDS_COMPATABILITY_JAN2022 - if (BasePolicyText.empty()) - { - BasePolicyText = Object["DefaultValuePolicy"sv].AsString(); - } -#endif if (BasePolicyText.empty()) { return {}; @@ -228,14 +222,10 @@ CacheRecordPolicy::Load(const CbObjectView Object) return {}; } CachePolicy Policy = ParseCachePolicy(PolicyText); -#if BACKWARDS_COMPATABILITY_JAN2022 - Policy = Policy & CacheValuePolicy::PolicyMask; -#else if (EnumHasAnyFlags(Policy, ~CacheValuePolicy::PolicyMask)) { return {}; } -#endif Builder.AddValuePolicy(Id, Policy); } diff --git a/zenutil/include/zenutil/cache/cachepolicy.h b/zenutil/include/zenutil/cache/cachepolicy.h index efcc4fb49..b249982fc 100644 --- a/zenutil/include/zenutil/cache/cachepolicy.h +++ b/zenutil/include/zenutil/cache/cachepolicy.h @@ -11,13 +11,6 @@ #include #include -#define BACKWARDS_COMPATABILITY_JAN2022 1 -#if BACKWARDS_COMPATABILITY_JAN2022 -# define BACKWARDS_COMPATABILITY_JAN2022_CODE(...) __VA_ARGS__ -#else -# define BACKWARDS_COMPATABILITY_JAN2022_CODE(...) -#endif - namespace zen::Private { class ICacheRecordPolicyShared; } -- cgit v1.2.3