remove many unnecessary destructors
This commit is contained in:
parent
b16a3338b5
commit
993dd6c5bc
|
@ -101,17 +101,6 @@ final class Constructor
|
||||||
addConstructorScalar("tag:yaml.org,2002:merge", &constructMerge);
|
addConstructorScalar("tag:yaml.org,2002:merge", &constructMerge);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy the constructor.
|
|
||||||
@nogc pure @safe nothrow ~this()
|
|
||||||
{
|
|
||||||
fromScalar_.destroy();
|
|
||||||
fromScalar_ = null;
|
|
||||||
fromSequence_.destroy();
|
|
||||||
fromSequence_ = null;
|
|
||||||
fromMapping_.destroy();
|
|
||||||
fromMapping_ = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Add a constructor function from scalar.
|
/** Add a constructor function from scalar.
|
||||||
*
|
*
|
||||||
* The function must take a reference to $(D Node) to construct from.
|
* The function must take a reference to $(D Node) to construct from.
|
||||||
|
|
|
@ -126,13 +126,6 @@ struct Loader
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy the Loader.
|
|
||||||
@trusted ~this()
|
|
||||||
{
|
|
||||||
reader_.destroy();
|
|
||||||
scanner_.destroy();
|
|
||||||
parser_.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Set stream _name. Used in debugging messages.
|
/// Set stream _name. Used in debugging messages.
|
||||||
void name(string name) pure @safe nothrow @nogc
|
void name(string name) pure @safe nothrow @nogc
|
||||||
|
|
|
@ -142,16 +142,6 @@ final class Parser
|
||||||
marks_.reserve(32);
|
marks_.reserve(32);
|
||||||
}
|
}
|
||||||
|
|
||||||
///Destroy the parser.
|
|
||||||
@trusted ~this()
|
|
||||||
{
|
|
||||||
currentEvent_.destroy();
|
|
||||||
tagDirectives_.destroy();
|
|
||||||
tagDirectives_ = null;
|
|
||||||
states_.destroy();
|
|
||||||
marks_.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the next event is one of specified types.
|
* Check if the next event is one of specified types.
|
||||||
*
|
*
|
||||||
|
|
|
@ -81,13 +81,6 @@ final class Representer
|
||||||
addRepresenter!SysTime(&representSysTime);
|
addRepresenter!SysTime(&representSysTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
///Destroy the Representer.
|
|
||||||
~this() pure @safe nothrow
|
|
||||||
{
|
|
||||||
representers_.destroy();
|
|
||||||
representers_ = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
///Set default _style for scalars. If style is $(D ScalarStyle.Invalid), the _style is chosen automatically.
|
///Set default _style for scalars. If style is $(D ScalarStyle.Invalid), the _style is chosen automatically.
|
||||||
@property void defaultScalarStyle(ScalarStyle style) pure @safe nothrow
|
@property void defaultScalarStyle(ScalarStyle style) pure @safe nothrow
|
||||||
{
|
{
|
||||||
|
|
|
@ -69,13 +69,6 @@ final class Resolver
|
||||||
if(defaultImplicitResolvers){addImplicitResolvers();}
|
if(defaultImplicitResolvers){addImplicitResolvers();}
|
||||||
}
|
}
|
||||||
|
|
||||||
///Destroy the Resolver.
|
|
||||||
~this() pure @safe nothrow
|
|
||||||
{
|
|
||||||
yamlImplicitResolvers_.destroy();
|
|
||||||
yamlImplicitResolvers_ = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an implicit scalar resolver.
|
* Add an implicit scalar resolver.
|
||||||
*
|
*
|
||||||
|
|
|
@ -170,16 +170,6 @@ final class Scanner
|
||||||
fetchStreamStart();
|
fetchStreamStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Destroy the scanner.
|
|
||||||
~this() @trusted
|
|
||||||
{
|
|
||||||
tokens_.destroy();
|
|
||||||
indents_.destroy();
|
|
||||||
possibleSimpleKeys_.destroy();
|
|
||||||
possibleSimpleKeys_ = null;
|
|
||||||
reader_ = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Check if the next token is one of specified types.
|
/// Check if the next token is one of specified types.
|
||||||
///
|
///
|
||||||
/// If no types are specified, checks if any tokens are left.
|
/// If no types are specified, checks if any tokens are left.
|
||||||
|
|
|
@ -85,12 +85,6 @@ struct Serializer
|
||||||
~this() @safe
|
~this() @safe
|
||||||
{
|
{
|
||||||
emitter_.emit(streamEndEvent(Mark(), Mark()));
|
emitter_.emit(streamEndEvent(Mark(), Mark()));
|
||||||
YAMLVersion_.destroy();
|
|
||||||
YAMLVersion_ = null;
|
|
||||||
serializedNodes_.destroy();
|
|
||||||
serializedNodes_ = null;
|
|
||||||
anchors_.destroy();
|
|
||||||
anchors_ = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///Serialize a node, emitting it in the process.
|
///Serialize a node, emitting it in the process.
|
||||||
|
|
Loading…
Reference in a new issue