You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* Returns the next child held by this structure. Useful for iterating over its children when parsing complex structures.
* @throws [Asn1StructuralException] if no more children are available
*/
@Throws(Asn1StructuralException::class)
fun nextChild() = children.getOrElse(index++) { throw Asn1StructuralException("No more content left") }
/**
* Exception-free version of [nextChild]
*/
fun nextChildOrNull() = children.getOrNull(index++)
The text was updated successfully, but these errors were encountered:
Thank you very much! There are probably a handful of locations, where it is possible to get around throwing and catching.
The more pressing issue wrt. performance is not rooted in this project, though, but in KmmResult, which cannot be a value class, as it would make it impossible to export it to an XC framework. Thus, catching incurs a performance hit. At the same time runCatching catches more than it should, so we require catching.
I'll not that down for improving API docs. peek already returns null, if no more children are left. All the feedback you have provided so far is really appreciated!
signum/indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt
Lines 432 to 443 in e8f9bd4
The text was updated successfully, but these errors were encountered: