From 47ee5b031ed36f23ae34ff0ba41f6b686df5f4f2 Mon Sep 17 00:00:00 2001 From: Christian Berger Date: Wed, 27 May 2020 17:19:48 +0200 Subject: [PATCH] Integrating @olbender's suggestion --- stringtoolbox.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stringtoolbox.hpp b/stringtoolbox.hpp index dfdeb81..62a7b89 100644 --- a/stringtoolbox.hpp +++ b/stringtoolbox.hpp @@ -1,7 +1,7 @@ /* * MIT License * - * Copyright (c) 2018 Christian Berger + * Copyright (c) 2018-2020 Christian Berger * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -82,7 +82,7 @@ inline std::vector split(const std::string &str, retVal.emplace_back(""); } } - if ((prev > 0) && (prev < str.size())) { + if (prev < str.size()) { retVal.emplace_back(str.substr(prev, str.size() - prev)); } else if (prev > 0) {