Skip to content

Commit

Permalink
Do not use regex library anymore in PathBuilder.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Dec 18, 2023
1 parent 2db8120 commit 8cb0cb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions architecture/faust/gui/PathBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <map>
#include <string>
#include <algorithm>
#include <regex>

#include "faust/export.h"

Expand Down Expand Up @@ -64,9 +63,15 @@ class FAUST_API PathBuilder {
* @param src
* @return modified string
*/
std::string remove0x00(const std::string& src) const
std::string remove0x00(const std::string& src_aux) const
{
return std::regex_replace(src, std::regex("/0x00"), "");
std::string src = src_aux;
std::string from = "/0x00";
std::string to = "";
for (size_t pos = src.find(from); pos != std::string::npos; pos = src.find(from, pos + 1)) {
src.replace(pos, from.length(), to);
}
return src;
}

/**
Expand Down
1 change: 1 addition & 0 deletions compiler/generator/jsfx/jsfx_instructions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <string>
#include <unordered_map>
#include <regex>

#include "text_instructions.hh"
#include "struct_manager.hh"
Expand Down

0 comments on commit 8cb0cb3

Please sign in to comment.