File: goversion_makemap_gte_go19.go

package info (click to toggle)
golang-github-ugorji-go-codec 1.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 2,844 kB
  • sloc: python: 98; makefile: 8
file content (15 lines) | stat: -rw-r--r-- 358 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.

// +build go1.9

package codec

import "reflect"

func makeMapReflect(t reflect.Type, size int) reflect.Value {
	if size < 0 {
		return reflect.MakeMapWithSize(t, 4)
	}
	return reflect.MakeMapWithSize(t, size)
}