From d3484e73824b5475f2b00bf3935a1cfeac54461f Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 3 Jun 2014 17:55:06 -0700 Subject: [PATCH] Get the end time of the last line in a less dumb way --- src/subtitle_format_ttxt.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/subtitle_format_ttxt.cpp b/src/subtitle_format_ttxt.cpp index 26391e072..d2af0a6d3 100644 --- a/src/subtitle_format_ttxt.cpp +++ b/src/subtitle_format_ttxt.cpp @@ -40,7 +40,6 @@ #include "compat.h" #include "options.h" -#include #include DEFINE_EXCEPTION(TTXTParseError, SubtitleFormatParseError); @@ -258,10 +257,8 @@ void TTXTSubtitleFormat::ConvertToTTXT(AssFile &file) const { // Find last line AssTime lastTime; - for (auto const& line : file.Events | boost::adaptors::reversed) { - lastTime = line.End; - break; - } + if (!file.Events.empty()) + lastTime = file.Events.back().End; // Insert blank line at the end auto diag = new AssDialogue;