Revision: 1103
http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1103&view=rev
Author: roman_yakovenko
Date: 2007-08-17 22:31:20 -0700 (Fri, 17 Aug 2007)
Log Message:
-----------
optimizing - find_value_type function - remove unnecessary recursion
Modified Paths:
--------------
pygccxml_dev/pygccxml/declarations/type_traits.py
Modified: pygccxml_dev/pygccxml/declarations/type_traits.py
===================================================================
--- pygccxml_dev/pygccxml/declarations/type_traits.py 2007-08-18 05:25:18 UTC (rev 1102)
+++ pygccxml_dev/pygccxml/declarations/type_traits.py 2007-08-18 05:31:20 UTC (rev 1103)
@@ -931,8 +931,9 @@
, function=lambda decl: not isinstance( decl, calldef.calldef_t )
, allow_empty=True )
if not found:
- if cpptypes.FUNDAMENTAL_TYPES.has_key( value_type_str[2:] ): #remove leading ::
- return cpptypes.FUNDAMENTAL_TYPES[value_type_str[2:]]
+ no_global_ns_value_type_str = value_type_str[2:]
+ if cpptypes.FUNDAMENTAL_TYPES.has_key( no_global_ns_value_type_str ):
+ return cpptypes.FUNDAMENTAL_TYPES[ no_global_ns_value_type_str ]
elif is_std_string( value_type_str ):
string_ = global_ns.typedef( '::std::string' )
return remove_declarated( string_ )
@@ -940,14 +941,16 @@
string_ = global_ns.typedef( '::std::wstring' )
return remove_declarated( string_ )
else:
- value_type_str = value_type_str[2:]#removing leading ::
+ value_type_str = no_global_ns_value_type_str
has_const = value_type_str.startswith( 'const ' )
if has_const:
value_type_str = value_type_str[ len('const '): ]
has_pointer = value_type_str.endswith( '*' )
if has_pointer:
value_type_str = value_type_str[:-1]
- found = impl_details.find_value_type( global_ns, value_type_str )
+ found = None
+ if has_const or has_pointer:
+ found = impl_details.find_value_type( global_ns, value_type_str )
if not found:
return None
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|