std/jpeg: call slice.bulk_memset

This commit is contained in:
Nigel Tao committed 2023-06-04 21:22:14 +10:00
1 parent 5edfe45e15
commit 2f18dc61d0
8 files changed
+160 -91

No files matched your search

+10 -2
View File
@@ -730,8 +730,16 @@ func (q *checker) tcheckDot(n *a.Expr, depth uint32) error {
qqid[0] = t.IDBase
qqid[1] = t.IDDagger1
if q.c.isBuiltInSliceFunc(qqid, lTyp) {
n.SetMType(a.NewTypeExpr(t.IDFunc, 0, n.Ident(), lTyp.AsNode(), nil, nil))
return nil
bulky := false
switch qqid[2] {
case t.IDBulkMemset:
bulky = true
}
if !bulky || lTyp.Inner().IsBulkNumType() {
n.SetMType(a.NewTypeExpr(t.IDFunc, 0, n.Ident(), lTyp.AsNode(), nil, nil))
return nil
}
}
return fmt.Errorf("check: no %s method %q", lTyp.Decorator().Str(q.tm), n.Ident().Str(q.tm))