Improve and simplify code with modern C++ features
Change-Id: I28d84df3087492ab2ecbeb91169a2cde12c9e31e
diff --git a/src/util/regex/regex-top-matcher.cpp b/src/util/regex/regex-top-matcher.cpp
index 0c2ac9a..3514951 100644
--- a/src/util/regex/regex-top-matcher.cpp
+++ b/src/util/regex/regex-top-matcher.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -172,9 +172,9 @@
{
std::string regexStr("^");
- for (auto it = name.begin(); it != name.end(); it++) {
+ for (const auto& i : name) {
regexStr.append("<");
- regexStr.append(convertSpecialChar(it->toUri()));
+ regexStr.append(convertSpecialChar(i.toUri()));
regexStr.append(">");
}