Commit fe3ca60f1a1f21cad93ddb6275c495997fa4caf9

Authored by Perry Werneck
1 parent 9209d08d
Exists in master and in 1 other branch develop

Fixing performance issues.

Showing 2 changed files with 4 additions and 10 deletions   Show diff stats
src/core/get.cc
@@ -35,8 +35,7 @@ @@ -35,8 +35,7 @@
35 35
36 try { 36 try {
37 37
38 - TN3270::Host &host = getSession();  
39 - worker(host); 38 + worker(getSession());
40 39
41 } catch(const std::system_error &e) { 40 } catch(const std::system_error &e) {
42 41
@@ -96,8 +95,6 @@ @@ -96,8 +95,6 @@
96 strncpy((char *) buffer, contents.c_str(), std::min((size_t) len,contents.size())); 95 strncpy((char *) buffer, contents.c_str(), std::min((size_t) len,contents.size()));
97 96
98 }); 97 });
99 -  
100 -  
101 } 98 }
102 99
103 HLLAPI_API_CALL hllapi_get_lu_name(LPSTR buffer, WORD len) { 100 HLLAPI_API_CALL hllapi_get_lu_name(LPSTR buffer, WORD len) {
src/core/keyboard.cc
@@ -35,14 +35,11 @@ static DWORD set(std::function<void(TN3270::Host &)> worker) noexcept { @@ -35,14 +35,11 @@ static DWORD set(std::function<void(TN3270::Host &)> worker) noexcept {
35 35
36 try { 36 try {
37 37
38 - TN3270::Host &host = getSession(); 38 + worker(getSession());
39 39
40 - if(!host.isConnected())  
41 - return HLLAPI_STATUS_DISCONNECTED; 40 + } catch(const std::system_error &e) {
42 41
43 - host.waitForReady();  
44 -  
45 - worker(host); 42 + return hllapi_translate_error(e);
46 43
47 } catch(const std::exception &e) { 44 } catch(const std::exception &e) {
48 45