Skip to content

Commit

Permalink
Improve #7906 (#7907)
Browse files Browse the repository at this point in the history
- Use the OMC interface instead of sendCommand to call countMessages,
  to further improve the performance over #7906.
  • Loading branch information
perost committed Sep 16, 2021
1 parent 4f5e805 commit c646540
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OMEdit/OMEditLIB/OMC/OMCProxy.cpp
Expand Up @@ -544,9 +544,9 @@ bool OMCProxy::printMessagesStringInternal()
int OMCProxy::getMessagesStringInternal()
{
// getMessagesStringInternal() is quite slow, check if there are any messages first.
sendCommand("countMessages()");
auto res = mpOMCInterface->countMessages();

if (getResult() != "(0,0,0)") {
if (res.numMessages || res.numErrors || res.numWarnings) {
sendCommand("errors:=getMessagesStringInternal()");
sendCommand("size(errors,1)");
return getResult().toInt();
Expand Down

0 comments on commit c646540

Please sign in to comment.