From 68e4a34d4381ad4d75f1c75ee67a23c95d747986 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 11 Feb 2011 10:05:37 -0800 Subject: uhd: tweak for io type size table code --- host/lib/types/types.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'host/lib') diff --git a/host/lib/types/types.cpp b/host/lib/types/types.cpp index bf308a0b3..7c65d2997 100644 --- a/host/lib/types/types.cpp +++ b/host/lib/types/types.cpp @@ -76,17 +76,16 @@ static std::vector get_tid_size_table(void){ return table; } -static size_t tid_to_size(io_type_t::tid_t tid){ - static const std::vector size_table(get_tid_size_table()); - return size_table[size_t(tid) & 0x7f]; -} +static const std::vector tid_size_table(get_tid_size_table()); -io_type_t::io_type_t(tid_t tid) -: size(tid_to_size(tid)), tid(tid){ +io_type_t::io_type_t(tid_t tid): + size(tid_size_table[size_t(tid) & 0x7f]), tid(tid) +{ /* NOP */ } -io_type_t::io_type_t(size_t size) -: size(size), tid(CUSTOM_TYPE){ +io_type_t::io_type_t(size_t size): + size(size), tid(CUSTOM_TYPE) +{ /* NOP */ } -- cgit v1.2.3