File: z.go

package info (click to toggle)
golang-github-coreos-discovery-etcd-io 2.0.0%2Bgit2019.04.19.git.78fb45d3c9-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 23,460 kB
  • sloc: asm: 452; sh: 94; ansic: 24; makefile: 16
file content (23 lines) | stat: -rw-r--r-- 826 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.

package codec

import "sort"

// TODO: this is brittle, as it depends on z.go's init() being called last.
// The current build tools all honor that files are passed in lexical order.
// However, we should consider using an init_channel,
// that each person doing init will write to.

func init() {
	if !useLookupRecognizedTypes {
		return
	}
	sort.Sort(uintptrSlice(recognizedRtids))
	sort.Sort(uintptrSlice(recognizedRtidPtrs))
	recognizedRtidOrPtrs = make([]uintptr, len(recognizedRtids)+len(recognizedRtidPtrs))
	copy(recognizedRtidOrPtrs, recognizedRtids)
	copy(recognizedRtidOrPtrs[len(recognizedRtids):], recognizedRtidPtrs)
	sort.Sort(uintptrSlice(recognizedRtidOrPtrs))
}