Skip to content

Commit

Permalink
update some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mokapsing committed Apr 3, 2024
1 parent a16a155 commit 559e389
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/rimestate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,10 @@ void RimeState::switchNextSchema() {
return;
}
targetSchemaId = *schemas.begin();
auto it = schemas.find(currentSchemaId);
if (it != schemas.end()) {
++it;
if (it != schemas.end()) {
targetSchemaId = *it;
if (!schemas.empty()) {
auto it = std::find(schemas.begin(), schemas.end(), currentSchemaId);
if (it != schemas.end() && std::next(it) != schemas.end()) {
targetSchemaId = *std::next(it);
}
}
if (targetSchemaId.empty()) {
Expand Down

0 comments on commit 559e389

Please sign in to comment.