locale_classes.h: Simplify RTTI checks.

2007-12-17  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/bits/locale_classes.h: Simplify RTTI checks.

From-SVN: r131020
This commit is contained in:
Jonathan Wakely 2007-12-17 22:07:39 +00:00 committed by Jonathan Wakely
parent 0d9f441aea
commit 44f37984f4
2 changed files with 7 additions and 13 deletions

View File

@ -1,3 +1,7 @@
2007-12-17 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/bits/locale_classes.h: Simplify RTTI checks.
2007-12-17 Jonathan Wakely <jwakely.gcc@gmail.com>
* docs/html/test.html: Fix paths and notes on running subset of tests.

View File

@ -579,17 +579,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
const size_t __i = _Facet::id._M_id();
const locale::facet** __facets = __loc._M_impl->_M_facets;
bool __b(false);
try
{
if (__i < __loc._M_impl->_M_facets_size
&& dynamic_cast<const _Facet*>(__facets[__i]) != NULL)
__b = true;
}
catch (...)
{ }
return __b;
return __i < __loc._M_impl->_M_facets_size
&& dynamic_cast<const _Facet*>(__facets[__i]) != NULL;
}
/**
@ -611,8 +602,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{
const size_t __i = _Facet::id._M_id();
const locale::facet** __facets = __loc._M_impl->_M_facets;
if (__i >= __loc._M_impl->_M_facets_size
|| dynamic_cast<const _Facet*>(__facets[__i]) == NULL)
if (__i >= __loc._M_impl->_M_facets_size || __facets[__i] == NULL)
__throw_bad_cast();
return dynamic_cast<const _Facet&>(*__facets[__i]);
}