security/ct/Buffer.cpp
author Byron Campen [:bwc] <docfaraday@gmail.com>
Thu, 21 Feb 2019 16:42:12 +0000
changeset 460286 c414d82a532508523d40ce63111cb30b2a1076be
parent 448947 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1521879 - Part 1: IPC-based MediaTransport implementation r=mjf Differential Revision: https://phabricator.services.mozilla.com/D17273

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "Buffer.h"

#include <string.h>

namespace mozilla {

bool operator==(const ct::Buffer& a, const ct::Buffer& b) {
  return (a.empty() && b.empty()) ||
         (a.size() == b.size() && memcmp(a.data(), b.data(), a.size()) == 0);
}

bool operator!=(const ct::Buffer& a, const ct::Buffer& b) { return !(a == b); }

}  // namespace mozilla