// setsArEqualHashable checks if two unordered ValueLists are equal, provided
// that they contain items that are hashable -- that is, the items can be used
// as keys in a map.
542153
func setsArEqualHashable(size int, l, r ValueList) bool {
	m := make(map[interface{}]bool, size)
	// explicitly ignoring since we know there will not be an error
	_ = l.ForEach(func(v Value) error {
		m[toHashable(v)] = true
		return nil
	})

	return errNotEquals != r.ForEach(func(v Value) error {
		if _, ok := m[toHashable(v)]; !ok {
			return errNotEquals
		}
		return nil
	})
}
914486
func (h *HashMap) Equal(other *HashMap) bool {
	if h.Len() != other.Len() {
		return false
	}
	return !h.Iter(func(k, v T) bool {
		ov, ok := other.Get(k)
		if !ok {
			return true
		}
		return !h.eq(v, ov)
	})
}
222849
func (s *CertificateDetail) SetRenewalEligibility(v string) *CertificateDetail {
	s.RenewalEligibility = &v
	return s
}
91796
func (s *PutComplianceItemsInput) SetItemContentHash(v string) *PutComplianceItemsInput {
	s.ItemContentHash = &v
	return s
}
634903
func (a *GetEncodedResponseArgs) SetQuality(quality float64) *GetEncodedResponseArgs {
	a.Quality = &quality
	return a
}
1368905
func IsValidHasher(hasher string) bool {
	switch hasher {
	case
		Argon2Hasher,
		BCryptHasher,
		BCryptSHA256Hasher,
		CryptHasher,
		MD5Hasher,
		PBKDF2SHA1Hasher,
		PBKDF2SHA256Hasher,
		SHA1Hasher,
		UnsaltedMD5Hasher,
		UnsaltedSHA1Hasher:
		return true
	}

	return false
}
220353
func ObjectsAreEqualValues(expected, actual interface{}) bool {
	if ObjectsAreEqual(expected, actual) {
		return true
	}

	actualType := reflect.TypeOf(actual)
	if actualType == nil {
		return false
	}
	expectedValue := reflect.ValueOf(expected)
	if expectedValue.IsValid() && expectedValue.Type().ConvertibleTo(actualType) {
		// Attempt comparison after type conversion
		return reflect.DeepEqual(expectedValue.Convert(actualType).Interface(), actual)
	}

	return false
}
1297841
func (u *Unit) setPasswordHash(passwordHash string) error {
	ops := []txn.Op{{
		C:      unitsC,
		Id:     u.doc.DocID,
		Assert: notDeadDoc,
		Update: bson.D{{"$set", bson.D{{"passwordhash", passwordHash}}}},
	}}
	err := u.st.db().RunTransaction(ops)
	if err != nil {
		return fmt.Errorf("cannot set password of unit %q: %v", u, onAbort(err, ErrDead))
	}
	u.doc.PasswordHash = passwordHash
	return nil
}
1235485
func (up *Updater) EqualHashes(files map[string]*file.File) bool {
	for _, f := range files {
		log.Println("Checking file for changes:", f.Path)

		if len(f.Bytes) == 0 && !f.ReplacedText {
			data, err := ioutil.ReadFile(f.OriginalPath)
			if err != nil {
				panic(err)
			}

			f.Bytes = data

			// removes the []byte("") from the string
			// when the data isn't in the Bytes variable
		} else if len(f.Bytes) == 0 && f.ReplacedText && len(f.Data) > 0 {
			f.Data = strings.TrimPrefix(f.Data, `[]byte("`)
			f.Data = strings.TrimSuffix(f.Data, `")`)
			f.Data = strings.Replace(f.Data, "\\x", "", -1)

			var err error
			f.Bytes, err = hex.DecodeString(f.Data)
			if err != nil {
				log.Println("SHIT", err)
				return false
			}

			f.Data = ""
		}

		sha := sha256.New()
		if _, err := sha.Write(f.Bytes); err != nil {
			panic(err)
			return false
		}

		up.LocalHashes[f.Path] = hex.EncodeToString(sha.Sum(nil))
	}

	// check if there is any file to update
	update := false
	for k := range up.LocalHashes {
		if !up.EqualHash(k) {
			up.ToUpdate = append(up.ToUpdate, k)
			update = true
		}
	}

	return !update
}
830263
func HashEqual(a, b noder.Hasher) bool {
	return bytes.Equal(a.Hash(), b.Hash())
}
151395
func (h *HLL) AddWithHasher(value string, hasher func(string) uint64) {
	hash := hasher(value)
	h.AddHash(hash)
}
168211
func (s *JobDescription) SetArchiveSHA256TreeHash(v string) *JobDescription {
	s.ArchiveSHA256TreeHash = &v
	return s
}
1349279
func (s *Set) HashEqual(raw interface{}) bool {
	other, ok := raw.(*Set)
	if !ok {
		return false
	}

	ks1 := make([]string, 0)
	ks2 := make([]string, 0)

	for k := range s.m {
		ks1 = append(ks1, k)
	}
	for k := range other.m {
		ks2 = append(ks2, k)
	}

	sort.Strings(ks1)
	sort.Strings(ks2)

	return reflect.DeepEqual(ks1, ks2)
}
568680
func (a *CaptureScreenshotArgs) SetQuality(quality int) *CaptureScreenshotArgs {
	a.Quality = &quality
	return a
}
194298
func (p *PhysicalHashJoin) SetCorrelated() {
	p.basePlan.SetCorrelated()
	for _, cond := range p.EqualConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
	for _, cond := range p.LeftConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
	for _, cond := range p.RightConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
	for _, cond := range p.OtherConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
}
1215153
func (s *SelectableAttribute) SetEqualer(e Equaler) {
	if s.chooser.Demand().(BoolEqualer).B {
		s.attr.SetEqualer(e)
	}
}
299785
func BlocksEqual(a, b []BlockInfo) bool {
	if len(b) != len(a) {
		return false
	}

	for i, sblk := range a {
		if !bytes.Equal(sblk.Hash, b[i].Hash) {
			return false
		}
	}

	return true
}