diff --git a/spot/priv/trim.cc b/spot/priv/trim.cc index ad8dbbf64..a5f6c9c50 100644 --- a/spot/priv/trim.cc +++ b/spot/priv/trim.cc @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2015, 2018 Laboratoire de Recherche et Developpement +// Copyright (C) 2015, 2018, 2019 Laboratoire de Recherche et Developpement // de l'Epita (LRDE). // // This file is part of Spot, a model checking library. @@ -20,7 +20,6 @@ #include "config.h" #include #include -#include #include #include @@ -29,12 +28,9 @@ namespace spot void trim(std::string& str) { - str.erase(std::find_if(str.rbegin(), str.rend(), - std::not1(std::ptr_fun - (std::isspace))).base(), + auto not_space = [](unsigned char c){ return !std::isspace(c); }; + str.erase(std::find_if(str.rbegin(), str.rend(), not_space).base(), str.end()); - str.erase(str.begin(), - std::find_if(str.begin(), str.end(), - std::not1(std::ptr_fun(std::isspace)))); + str.erase(str.begin(), std::find_if(str.begin(), str.end(), not_space)); } }