diff options
author | Neil <nyamatongwe@gmail.com> | 2021-10-12 12:02:39 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-10-12 12:02:39 +1100 |
commit | 895d7811901871cc32afb598fafa2b60e4df666c (patch) | |
tree | 178e7600fc636ada358b5b3ef4bff0bda167cba5 | |
parent | b4fd2631f64008179d7e7a7e5d9194a08f30a66b (diff) | |
download | scintilla-mirror-895d7811901871cc32afb598fafa2b60e4df666c.tar.gz |
Minor code simplifications from clang-tidy.
-rwxr-xr-x | gtk/ScintillaGTK.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index cf453bd6e..c64e2dca9 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1300,7 +1300,7 @@ struct CaseMapper { } std::string ScintillaGTK::CaseMapString(const std::string &s, CaseMapping caseMapping) { - if ((s.size() == 0) || (caseMapping == CaseMapping::same)) + if (s.empty() || (caseMapping == CaseMapping::same)) return s; if (IsUnicodeMode()) { @@ -1650,7 +1650,7 @@ void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, Se std::unique_ptr<SelectionText> newline_normalized; { std::string tmpstr = Document::TransformLineEnds(text->Data(), text->Length(), EndOfLine::Lf); - newline_normalized.reset(new SelectionText()); + newline_normalized = std::make_unique<SelectionText>(); newline_normalized->Copy(tmpstr, CpUtf8, CharacterSet::Ansi, text->rectangular, false); text = newline_normalized.get(); } @@ -2446,7 +2446,7 @@ std::vector<int> MapImeIndicators(PangoAttrList *attrs, const char *u8Str) { void ScintillaGTK::SetCandidateWindowPos() { // Composition box accompanies candidate box. const Point pt = PointMainCaret(); - GdkRectangle imeBox = {0}; // No need to set width + GdkRectangle imeBox {}; imeBox.x = static_cast<gint>(pt.x); imeBox.y = static_cast<gint>(pt.y + std::max(4, vs.lineHeight/4)); // prevent overlapping with current line @@ -3008,7 +3008,7 @@ gboolean ScintillaGTK::IdleCallback(gpointer pSci) { // Idler will be automatically stopped, if there is nothing // to do while idle. const bool ret = sciThis->Idle(); - if (ret == false) { + if (!ret) { // FIXME: This will remove the idler from GTK, we don't want to // remove it as it is removed automatically when this function // returns false (although, it should be harmless). |