forked from OSchip/llvm-project
[llvm-objdump] Use initializer list for scoped xar api constructors
llvm-svn: 315243
This commit is contained in:
parent
c084589877
commit
57d8452a63
|
@ -206,9 +206,8 @@ typedef DiceTable::iterator dice_table_iterator;
|
|||
namespace {
|
||||
struct ScopedXarFile {
|
||||
xar_t xar;
|
||||
ScopedXarFile(const char *filename, int32_t flags) {
|
||||
xar = xar_open(filename, flags);
|
||||
}
|
||||
ScopedXarFile(const char *filename, int32_t flags)
|
||||
: xar(xar_open(filename, flags)) {}
|
||||
~ScopedXarFile() {
|
||||
if (xar)
|
||||
xar_close(xar);
|
||||
|
@ -220,7 +219,7 @@ struct ScopedXarFile {
|
|||
|
||||
struct ScopedXarIter {
|
||||
xar_iter_t iter;
|
||||
ScopedXarIter() { iter = xar_iter_new(); }
|
||||
ScopedXarIter() : iter(xar_iter_new()) {}
|
||||
~ScopedXarIter() {
|
||||
if (iter)
|
||||
xar_iter_free(iter);
|
||||
|
|
Loading…
Reference in New Issue