Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for eachDir (0.09 sec)

  1. src/net/http/mapping.go

    		return v, found
    	}
    	for _, e := range h.s {
    		if e.key == k {
    			return e.value, true
    		}
    	}
    	return v, false
    }
    
    // eachPair calls f for each pair in the mapping.
    // If f returns false, pairs returns immediately.
    func (h *mapping[K, V]) eachPair(f func(k K, v V) bool) {
    	if h == nil {
    		return
    	}
    	if h.m != nil {
    		for k, v := range h.m {
    			if !f(k, v) {
    				return
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 17:47:07 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  2. src/net/http/mapping_test.go

    	var want []entry[int, string]
    	for i := 0; i < maxSlice*2; i++ {
    		v := strconv.Itoa(i)
    		m.add(i, v)
    		want = append(want, entry[int, string]{i, v})
    
    	}
    
    	var got []entry[int, string]
    	m.eachPair(func(k int, v string) bool {
    		got = append(got, entry[int, string]{k, v})
    		return true
    	})
    	slices.SortFunc(got, func(e1, e2 entry[int, string]) int {
    		return cmp.Compare(e1.key, e2.key)
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 17:47:07 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  3. src/net/http/routing_tree_test.go

    		fmt.Fprintf(w, "%s%q\n", indent, n.pattern)
    	}
    	if n.emptyChild != nil {
    		fmt.Fprintf(w, "%s%q:\n", indent, "")
    		n.emptyChild.print(w, level+1)
    	}
    
    	var keys []string
    	n.children.eachPair(func(k string, _ *routingNode) bool {
    		keys = append(keys, k)
    		return true
    	})
    	slices.Sort(keys)
    
    	for _, k := range keys {
    		fmt.Fprintf(w, "%s%q:\n", indent, k)
    		n, _ := n.children.find(k)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 30 15:43:24 UTC 2024
    - 7K bytes
    - Viewed (0)
  4. src/net/http/routing_tree.go

    	if methodSet["GET"] {
    		methodSet["HEAD"] = true
    	}
    }
    
    func (n *routingNode) matchingMethodsPath(path string, set map[string]bool) {
    	if n == nil {
    		return
    	}
    	n.children.eachPair(func(method string, c *routingNode) bool {
    		if p, _ := c.matchPath(path, nil); p != nil {
    			set[method] = true
    		}
    		return true
    	})
    	// Don't look at the empty child. If there were an empty
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 30 15:43:24 UTC 2024
    - 7.5K bytes
    - Viewed (0)
Back to top