From a16eb14fd45ad61ce028c7c420f5487c5cdbb6b7 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 23 May 2021 00:23:05 +0100 Subject: Minor tidy up of replStream --- lib/input/replStream.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/input/replStream.cpp b/lib/input/replStream.cpp index 0de91b5..2ec2a79 100644 --- a/lib/input/replStream.cpp +++ b/lib/input/replStream.cpp @@ -2,6 +2,7 @@ #include "mariadb_repl.h" #include #include +#include #include #include #include @@ -21,16 +22,12 @@ namespace MyGrate::Input { mariadb_rpl_optionsv(rpl.get(), MARIADB_RPL_START, 4); mariadb_rpl_optionsv(rpl.get(), MARIADB_RPL_FLAGS, MARIADB_RPL_BINLOG_SEND_ANNOTATE_ROWS); - if (mariadb_rpl_open(rpl.get())) { - throw std::runtime_error("Failed to mariadb_rpl_open"); - } + verify(!mariadb_rpl_open(rpl.get()), "Failed to mariadb_rpl_open"); while (MyGrate::MariaDB_Event_Ptr event {mariadb_rpl_fetch(rpl.get(), nullptr), &mariadb_free_rpl_event}) { - const auto & h = eventHandlers.at(event->event_type); - if (h.func) { + if (const auto & h = eventHandlers.at(event->event_type); h.func) { (eh.*h.func)(std::move(event)); } } } - } -- cgit v1.2.3