mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
check unused and unmodified vars in all modules, not just main
This commit is contained in:
@@ -81,11 +81,11 @@ pub fn (b mut Benchmark) neither_fail_nor_ok() {
|
||||
b.step_end_time = benchmark.now()
|
||||
}
|
||||
|
||||
pub fn (b mut Benchmark) step_message(msg string) string {
|
||||
pub fn (b &Benchmark) step_message(msg string) string {
|
||||
return b.tdiff_in_ms(msg, b.step_start_time, b.step_end_time)
|
||||
}
|
||||
|
||||
pub fn (b mut Benchmark) total_message(msg string) string {
|
||||
pub fn (b &Benchmark) total_message(msg string) string {
|
||||
mut tmsg := '$msg \n ok, fail, total = ' +
|
||||
term.ok_message('${b.nok:5d}') + ', ' +
|
||||
if b.nfail > 0 { term.fail_message('${b.nfail:5d}') } else { '${b.nfail:5d}' } + ', ' +
|
||||
@@ -96,12 +96,12 @@ pub fn (b mut Benchmark) total_message(msg string) string {
|
||||
return b.tdiff_in_ms(tmsg, b.bench_start_time, b.bench_end_time)
|
||||
}
|
||||
|
||||
pub fn (b mut Benchmark) total_duration() i64 {
|
||||
pub fn (b &Benchmark) total_duration() i64 {
|
||||
return (b.bench_end_time - b.bench_start_time)
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
fn (b mut Benchmark) tdiff_in_ms(s string, sticks i64, eticks i64) string {
|
||||
fn (b &Benchmark) tdiff_in_ms(s string, sticks i64, eticks i64) string {
|
||||
if b.verbose {
|
||||
tdiff := (eticks - sticks)
|
||||
return '${tdiff:6lld} ms | $s'
|
||||
|
Reference in New Issue
Block a user