performance improvement

This commit is contained in:
witer33 2021-10-04 10:05:47 +02:00 committed by GitHub
parent 147a0e7a44
commit ea14bd5c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -1,13 +1,11 @@
import builder, parser, types, strtabs
type Engine* = ref object of RootObj
html*: string
tags: seq[Tag]
method run*(this: Engine) {.base.} =
var parser = Parser(html: this.html)
method run*(this: Engine, html: string) {.base.} =
var parser = Parser(html: html)
var builder = Builder(parser: parser)
parser.parse_tokens()
builder.build()
this.tags = builder.get_tags()