From 93ee565c32bc12ae87aa3696a7b284f8958010ce Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 6 Oct 2009 23:25:32 +0000 Subject: Shrink. git-svn-id: http://svn.drobilla.net/resp/tuplr@201 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/tuplr.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/tuplr.hpp b/src/tuplr.hpp index c31e000..0141592 100644 --- a/src/tuplr.hpp +++ b/src/tuplr.hpp @@ -199,13 +199,11 @@ struct AST : public Object { template T const to() const { return dynamic_cast(this); } template T as() { T t = dynamic_cast(this); - if (!t) throw Error(loc, "internal error: bad cast"); - return t; + return t ? t : throw Error(loc, "internal error: bad cast"); } template T const as() const { T const t = dynamic_cast(this); - if (!t) throw Error(loc, "internal error: bad cast"); - return t; + return t ? t : throw Error(loc, "internal error: bad cast"); } Cursor loc; }; -- cgit v1.2.1