]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/bits/regex_automaton.tcc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / bits / regex_automaton.tcc
index 7a0e6a36a7a6898fba85f83300fbb45af64deefb..ff7b627755727fa8ba90d3f24ce298eb4943b47b 100644 (file)
@@ -1,6 +1,6 @@
 // class template regex -*- C++ -*-
 
-// Copyright (C) 2013-2018 Free Software Foundation, Inc.
+// Copyright (C) 2013-2024 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -36,34 +36,34 @@ namespace __detail
 {
 #ifdef _GLIBCXX_DEBUG
   inline std::ostream&
-  _State_base::_M_print(std::ostream& ostr) const
+  _State_base::_M_print(std::ostream& __ostr) const
   {
     switch (_M_opcode)
     {
       case _S_opcode_alternative:
       case _S_opcode_repeat:
-       ostr << "alt next=" << _M_next << " alt=" << _M_alt;
+       __ostr << "alt next=" << _M_next << " alt=" << _M_alt;
        break;
       case _S_opcode_subexpr_begin:
-       ostr << "subexpr begin next=" << _M_next << " index=" << _M_subexpr;
+       __ostr << "subexpr begin next=" << _M_next << " index=" << _M_subexpr;
        break;
       case _S_opcode_subexpr_end:
-       ostr << "subexpr end next=" << _M_next << " index=" << _M_subexpr;
+       __ostr << "subexpr end next=" << _M_next << " index=" << _M_subexpr;
        break;
       case _S_opcode_backref:
-       ostr << "backref next=" << _M_next << " index=" << _M_backref_index;
+       __ostr << "backref next=" << _M_next << " index=" << _M_backref_index;
        break;
       case _S_opcode_match:
-       ostr << "match next=" << _M_next;
+       __ostr << "match next=" << _M_next;
        break;
       case _S_opcode_accept:
-       ostr << "accept next=" << _M_next;
+       __ostr << "accept next=" << _M_next;
        break;
       default:
-       ostr << "unknown next=" << _M_next;
+       __ostr << "unknown next=" << _M_next;
        break;
     }
-    return ostr;
+    return __ostr;
   }
 
   // Prints graphviz dot commands for state.
@@ -194,8 +194,8 @@ namespace __detail
     _StateSeq<_TraitsT>
     _StateSeq<_TraitsT>::_M_clone()
     {
-      std::map<_StateIdT, _StateIdT> __m;
-      std::stack<_StateIdT> __stack;
+      _GLIBCXX_STD_C::map<_StateIdT, _StateIdT> __m;
+      std::stack<_StateIdT, _GLIBCXX_STD_C::deque<_StateIdT>> __stack;
       __stack.push(_M_start);
       while (!__stack.empty())
        {
@@ -220,16 +220,9 @@ namespace __detail
          auto __v = __it.second;
          auto& __ref = _M_nfa[__v];
          if (__ref._M_next != _S_invalid_state_id)
-           {
-             __glibcxx_assert(__m.count(__ref._M_next) > 0);
-             __ref._M_next = __m[__ref._M_next];
-           }
-         if (__ref._M_has_alt())
-           if (__ref._M_alt != _S_invalid_state_id)
-             {
-               __glibcxx_assert(__m.count(__ref._M_alt) > 0);
-               __ref._M_alt = __m[__ref._M_alt];
-             }
+           __ref._M_next = __m.find(__ref._M_next)->second;
+         if (__ref._M_has_alt() && __ref._M_alt != _S_invalid_state_id)
+           __ref._M_alt = __m.find(__ref._M_alt)->second;
        }
       return _StateSeq(_M_nfa, __m[_M_start], __m[_M_end]);
     }