From b1eea4a4d3de0f5762450d8ae880b6e84c6a267a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 15 Jul 2011 09:56:50 +1200 Subject: [PATCH] remove the need for warning suppression in Lazy/Cached --- OpenRA.FileFormats/Primitives/Cached.cs | 7 +------ OpenRA.FileFormats/Primitives/Lazy.cs | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/OpenRA.FileFormats/Primitives/Cached.cs b/OpenRA.FileFormats/Primitives/Cached.cs index 8823626eda..94d55648d9 100644 --- a/OpenRA.FileFormats/Primitives/Cached.cs +++ b/OpenRA.FileFormats/Primitives/Cached.cs @@ -39,12 +39,7 @@ namespace OpenRA.FileFormats } } - public void Force() - { - #pragma warning disable 0168 - var ignored = Value; - #pragma warning restore 0168 - } + public T Force() { return Value; } public void Invalidate() { diff --git a/OpenRA.FileFormats/Primitives/Lazy.cs b/OpenRA.FileFormats/Primitives/Lazy.cs index ed379d0ac8..ccdb8fbce3 100644 --- a/OpenRA.FileFormats/Primitives/Lazy.cs +++ b/OpenRA.FileFormats/Primitives/Lazy.cs @@ -38,12 +38,7 @@ namespace OpenRA.FileFormats } } - public void Force() - { - #pragma warning disable 0168 - var ignored = Value; - #pragma warning restore 0168 - } + public T Force() { return Value; } } public static class Lazy