diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-06-02 09:14:15 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-06-02 09:14:15 +0100 |
| commit | 51919d468831a876f31d5a6e2b25f8913314770d (patch) | |
| tree | b62e82991b9446498b7c6c71760aaec1bf09dbf3 /src/asset.cc | |
| parent | 8637a174f595f78070d88aadcc31a0216b58d857 (diff) | |
Use optional<> for _hash and make it private.
Diffstat (limited to 'src/asset.cc')
| -rw-r--r-- | src/asset.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/asset.cc b/src/asset.cc index 8753528b..60d3aab3 100644 --- a/src/asset.cc +++ b/src/asset.cc @@ -115,11 +115,11 @@ Asset::hash (function<void (float)> progress) const { DCP_ASSERT (!_file.empty ()); - if (_hash.empty ()) { + if (!_hash) { _hash = make_digest (_file, progress); } - return _hash; + return _hash.get(); } bool @@ -143,5 +143,5 @@ void Asset::set_file (boost::filesystem::path file) const { _file = boost::filesystem::absolute (file); - _hash.clear (); + _hash = optional<string> (); } |
