Repository: xbmc/xbmc
File: xbmc/settings/AdvancedSettings.cpp (C++)

Code before:
  //! Are we even going to have predefined paths??
  std::string tmp;
  if (XMLUtils::GetPath(pRootElement, "cachepath", tmp))
    m_cachePath = tmp;
  URIUtils::AddSlashAtEnd(m_cachePath);

  g_LangCodeExpander.LoadUserCodes(pRootElement->FirstChildElement("languagecodes"));

  // trailer matching regexps
  TiXmlElement* pTrailerMatching = pRootElement->FirstChildElement("trailermatching");
  if (pTrailerMatching)
    GetCustomRegexps(pTrailerMatching, m_trailerMatchRegExps);

  //everything that's a trailer is not a movie
  m_moviesExcludeFromScanRegExps.insert(m_moviesExcludeFromScanRegExps.end(),
                                        m_trailerMatchRegExps.begin(),
                                        m_trailerMatchRegExps.end());

  // video stacking regexps
  TiXmlElement* pVideoStacking = pRootElement->FirstChildElement("moviestacking");
  if (pVideoStacking)
  {
    auto regexes = CompileRegexesFromXML(pVideoStacking);
    regexes.erase(std::remove_if(regexes.begin(), regexes.end(), validateVideoStackRegex),
                  regexes.end());
    std::move(regexes.begin(), regexes.end(), std::back_inserter(m_videoStackRegExps));
  }

  // folder stacking regexps
  TiXmlElement* pFolderStacking = pRootElement->FirstChildElement("folderstacking");
  if (pFolderStacking)
  {
    auto regexes = CompileRegexesFromXML(pFolderStacking);
    std::move(regexes.begin(), regexes.end(), std::back_inserter(m_folderStackRegExps));
  }

  //tv stacking regexps
  TiXmlElement* pTVStacking = pRootElement->FirstChildElement("tvshowmatching");
  if (pTVStacking)
    GetCustomTVRegexps(pTVStacking, m_tvshowEnumRegExps);

  //tv multipart enumeration regexp
  XMLUtils::GetString(pRootElement, "tvmultipartmatching", m_tvshowMultiPartEnumRegExp);

  // path substitutions
  TiXmlElement* pPathSubstitution = pRootElement->FirstChildElement("pathsubstitution");
  if (pPathSubstitution)
  {
    m_pathSubstitutions.clear();
    CLog::Log(LOGDEBUG,"Configuring path substitutions");
    TiXmlNode* pSubstitute = pPathSubstitution->FirstChildElement("substitute");

Review comment (suggestion):
```suggestion
    std::ranges::move(regexes, std::back_inserter(m_videoStackRegExps));
```

Code after:
  CLangInfo::LoadTokens(pRootElement->FirstChild("sorttokens"), m_vecTokens);

  //! @todo Should cache path be given in terms of our predefined paths??
  //! Are we even going to have predefined paths??
  std::string tmp;
  if (XMLUtils::GetPath(pRootElement, "cachepath", tmp))
    m_cachePath = tmp;
  URIUtils::AddSlashAtEnd(m_cachePath);

  g_LangCodeExpander.LoadUserCodes(pRootElement->FirstChildElement("languagecodes"));

  // trailer matching regexps
  TiXmlElement* pTrailerMatching = pRootElement->FirstChildElement("trailermatching");
  if (pTrailerMatching)
    GetCustomRegexps(pTrailerMatching, m_trailerMatchRegExps);

  //everything that's a trailer is not a movie
  m_moviesExcludeFromScanRegExps.insert(m_moviesExcludeFromScanRegExps.end(),
                                        m_trailerMatchRegExps.begin(),
                                        m_trailerMatchRegExps.end());

  // video stacking regexps
  TiXmlElement* videoStacking = pRootElement->FirstChildElement("moviestacking");
  if (videoStacking)
  {
    std::vector<CRegExp> regexes = CompileRegexesFromXML(videoStacking);
    std::erase_if(regexes, std::not_fn(ValidateVideoStackRegex));
    std::ranges::move(regexes, std::back_inserter(m_videoStackRegExps));
  }

  // folder stacking regexps
  TiXmlElement* folderStacking = pRootElement->FirstChildElement("folderstacking");
  if (folderStacking)
  {
    std::vector<CRegExp> regexes = CompileRegexesFromXML(folderStacking);
    std::ranges::move(regexes, std::back_inserter(m_folderStackRegExps));
  }

  //tv stacking regexps
  TiXmlElement* pTVStacking = pRootElement->FirstChildElement("tvshowmatching");
  if (pTVStacking)
    GetCustomTVRegexps(pTVStacking, m_tvshowEnumRegExps);

  //tv multipart enumeration regexp
  XMLUtils::GetString(pRootElement, "tvmultipartmatching", m_tvshowMultiPartEnumRegExp);

  // path substitutions
  const TiXmlElement* pPathSubstitution = pRootElement->FirstChildElement("pathsubstitution");
  if (pPathSubstitution)
  {
    m_pathSubstitutions.clear();