Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for sortByRFC6724withSrcs (0.26 sec)

  1. src/net/addrselect_test.go

    			},
    			reverse: false,
    		},
    	}
    	for i, tt := range tests {
    		inCopy := make([]IPAddr, len(tt.in))
    		copy(inCopy, tt.in)
    		srcCopy := make([]netip.Addr, len(tt.in))
    		copy(srcCopy, tt.srcs)
    		sortByRFC6724withSrcs(inCopy, srcCopy)
    		if !reflect.DeepEqual(inCopy, tt.want) {
    			t.Errorf("test %d:\nin = %s\ngot: %s\nwant: %s\n", i, tt.in, inCopy, tt.want)
    		}
    		if tt.reverse {
    			copy(inCopy, tt.in)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 05 07:16:00 UTC 2022
    - 8.5K bytes
    - Viewed (0)
  2. src/net/addrselect.go

    // Minimal RFC 6724 address selection.
    
    package net
    
    import (
    	"net/netip"
    	"sort"
    )
    
    func sortByRFC6724(addrs []IPAddr) {
    	if len(addrs) < 2 {
    		return
    	}
    	sortByRFC6724withSrcs(addrs, srcAddrs(addrs))
    }
    
    func sortByRFC6724withSrcs(addrs []IPAddr, srcs []netip.Addr) {
    	if len(addrs) != len(srcs) {
    		panic("internal error")
    	}
    	addrAttr := make([]ipAttr, len(addrs))
    	srcAttr := make([]ipAttr, len(srcs))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 09 00:24:06 UTC 2024
    - 9.7K bytes
    - Viewed (0)
Back to top