Skip to content

Commit 72343b7

Browse files
authored
Merge pull request #136 from Kienyew/dev
Remove the use of boost::flyweight on entry_data
2 parents 01844c7 + f7deed1 commit 72343b7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ass_attachment.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ AssAttachment::AssAttachment(agi::fs::path const& name, AssEntryGroup group)
4444
agi::read_file_mapping file(name);
4545
auto buff = file.read();
4646
entry_data = (group == AssEntryGroup::FONT ? "fontname: " : "filename: ") + filename.get() + "\r\n";
47-
entry_data = entry_data.get() + agi::ass::UUEncode(buff, buff + file.size());
47+
entry_data += agi::ass::UUEncode(buff, buff + file.size());
4848
}
4949

5050
size_t AssAttachment::GetSize() const {
51-
auto header_end = entry_data.get().find('\n');
52-
return entry_data.get().size() - header_end - 1;
51+
auto header_end = entry_data.find('\n');
52+
return entry_data.size() - header_end - 1;
5353
}
5454

5555
void AssAttachment::Extract(agi::fs::path const& filename) const {
56-
auto header_end = entry_data.get().find('\n');
57-
auto decoded = agi::ass::UUDecode(entry_data.get().c_str() + header_end + 1, &entry_data.get().back() + 1);
56+
auto header_end = entry_data.find('\n');
57+
auto decoded = agi::ass::UUDecode(entry_data.c_str() + header_end + 1, &entry_data.back() + 1);
5858
agi::io::Save(filename, true).Get().write(&decoded[0], decoded.size());
5959
}
6060

src/ass_attachment.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/// @class AssAttachment
2424
class AssAttachment final : public AssEntry {
2525
/// ASS uuencoded entry data, including header.
26-
boost::flyweight<std::string> entry_data;
26+
std::string entry_data;
2727

2828
/// Name of the attached file, with SSA font mangling if it is a ttf
2929
boost::flyweight<std::string> filename;
@@ -35,7 +35,7 @@ class AssAttachment final : public AssEntry {
3535
size_t GetSize() const;
3636

3737
/// Add a line of data (without newline) read from a subtitle file
38-
void AddData(std::string const& data) { entry_data = entry_data.get() + data + "\r\n"; }
38+
void AddData(std::string const& data) { entry_data += data + "\r\n"; }
3939

4040
/// Extract the contents of this attachment to a file
4141
/// @param filename Path to save the attachment to

0 commit comments

Comments
 (0)