regex: modernize and simplify code
Change-Id: Ia4a3046d409ab1e5d8507da4d369dfee203f6256
diff --git a/src/util/regex/regex-backref-manager.hpp b/src/util/regex/regex-backref-manager.hpp
index be0f3dd..4e112d7 100644
--- a/src/util/regex/regex-backref-manager.hpp
+++ b/src/util/regex/regex-backref-manager.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2017 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -39,10 +39,16 @@
pushRef(const shared_ptr<RegexMatcher>& matcher);
void
- popRef();
+ popRef()
+ {
+ m_backrefs.pop_back();
+ }
size_t
- size() const;
+ size() const
+ {
+ return m_backrefs.size();
+ }
shared_ptr<RegexMatcher>
getBackref(size_t i) const;
@@ -51,28 +57,14 @@
std::vector<weak_ptr<RegexMatcher>> m_backrefs;
};
-
inline size_t
RegexBackrefManager::pushRef(const shared_ptr<RegexMatcher>& matcher)
{
- size_t last = m_backrefs.size();
- m_backrefs.push_back(matcher);
-
+ auto last = m_backrefs.size();
+ m_backrefs.emplace_back(matcher);
return last;
}
-inline void
-RegexBackrefManager::popRef()
-{
- m_backrefs.pop_back();
-}
-
-inline size_t
-RegexBackrefManager::size() const
-{
- return m_backrefs.size();
-}
-
inline shared_ptr<RegexMatcher>
RegexBackrefManager::getBackref(size_t i) const
{