Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util, parser: inline some fns #23535

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vlib/v/parser/parser.v
Original file line number Diff line number Diff line change
Expand Up @@ -3536,6 +3536,7 @@ fn (mut p Parser) parse_concrete_types() []ast.Type {
}

// is_generic_name returns true if the current token is a generic name.
@[inline]
fn (p &Parser) is_generic_name() bool {
return p.tok.kind == .name && util.is_generic_type_name(p.tok.lit)
}
Expand Down
3 changes: 3 additions & 0 deletions vlib/v/util/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,17 @@ pub fn ensure_modules_for_all_tools_are_installed(is_verbose bool) {
}
}

@[inline]
pub fn strip_mod_name(name string) string {
return name.all_after_last('.')
}

@[inline]
pub fn strip_main_name(name string) string {
return name.replace('main.', '')
}

@[inline]
pub fn no_dots(s string) string {
return s.replace('.', '__')
}
Expand Down
Loading