Skip to content

Commit

Permalink
Revert "Fix emoji search in dictionary (#234)"
Browse files Browse the repository at this point in the history
As regression has not been fixed :(
This reverts commits d0de5d3
  • Loading branch information
leha-bot committed Apr 16, 2020
1 parent ee48886 commit 2d2a39f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Telegram/SourceFiles/codegen/common/cpp_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ void writeLicense(QTextStream &stream, const ProjectInfo &project) {
CppFile::CppFile(const QString &path, const ProjectInfo &project)
: stream_(&content_)
, forceReGenerate_(project.forceReGenerate) {
stream_.setCodec("UTF-8");
bool cpp = path.toLower().endsWith(".cpp");

QFileInfo info(path);
Expand Down
8 changes: 4 additions & 4 deletions Telegram/SourceFiles/codegen/emoji/generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ const std::map<QString, int> EmojiMap = {\n\
\n";

for (auto &item : data_.map) {
source_->stream() << "{QString(\"" << item.first << "\")," << item.second << "},\n";
source_->stream() << "{\"" << item.first << "\"," << item.second << "},\n";
}
source_->stream() << "\
\n\
Expand Down Expand Up @@ -674,10 +674,10 @@ bool Generator::writeFindFromDictionary(const std::map<QString, int, std::greate
auto max_length = max_el->first.size();
source_->stream() << "\tstd::array<size_t, " << max_length + 1 << "> sizes;\n";
if (skipPostfixes) {
source_->stream() << "\tfor (int i=0,l=0; i<full_str.size() && l < " << max_length << R"code(; ++i) {
if (full_str[i] == kPostfix) {continue;}
source_->stream() << "\tfor (int i=0,l=0; i<str.size() && l < " << max_length << R"code(; ++i) {
if (str[i] == kPostfix) {continue;}
++l;
sizes[l]=i+1;
sizes[l]=i;
str+=full_str[i];
}
)code";
Expand Down

0 comments on commit 2d2a39f

Please sign in to comment.